From 0d2f2074cb64114fdd8aea5164e114d08d621f1b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 21 Mar 2012 17:11:05 -0500 Subject: [svn-r22117] Fix for HDFFV-7916 (Windows/POSIX correctness issues in the core VFD) and HDFFV-7603 (core VFD has trouble with 2GB+ files on Windows). Propagates the SEC2 driver fixes from HDF5 1.8.8 to the core VFD (mainly concerning the backing store). These fixes also conveniently fixed 7603 as well. Tested on: 64-bit Windows 7 jam koala ostrich --- src/H5FDcore.c | 271 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 164 insertions(+), 107 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 64cb1bb..940d4c7 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -38,8 +38,24 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_CORE_g = 0; -/* - * The description of a file belonging to this driver. The `eoa' and `eof' +/* Since Windows doesn't follow the rest of the world when it comes + * to POSIX I/O types, some typedefs and constants are needed to avoid + * making the code messy with #ifdefs. + * NOTE: These are only used when writing data to the backing store on + * file close. + */ +#ifdef H5_HAVE_WIN32_API +typedef unsigned int h5_core_io_t; +typedef int h5_core_io_ret_t; +static int H5_CORE_MAX_IO_BYTES_g = INT_MAX; +#else +/* Unix, everyone else */ +typedef size_t h5_core_io_t; +typedef ssize_t h5_core_io_ret_t; +static size_t H5_CORE_MAX_IO_BYTES_g = SSIZET_MAX; +#endif /* H5_HAVE_WIN32_API */ + +/* The description of a file belonging to this driver. The `eoa' and `eof' * determine the amount of hdf5 address space in use and the high-water mark * of the file (the current size of the underlying memory). */ @@ -54,8 +70,7 @@ typedef struct H5FD_core_t { int fd; /*backing store file descriptor */ /* Information for determining uniqueness of a file with a backing store */ #ifndef H5_HAVE_WIN32_API - /* - * On most systems the combination of device and i-node number uniquely + /* On most systems the combination of device and i-node number uniquely * identify a file. */ dev_t device; /*file device number */ @@ -65,18 +80,26 @@ typedef struct H5FD_core_t { ino_t inode; /*file i-node number */ #endif /*H5_VMS*/ #else - /* - * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the - * file and the volume serial number uniquely identify a file. This number - * (which, both? -rpm) may change when the system is restarted or when the - * file is opened. After a process opens a file, the identifier is - * constant until the file is closed. An application can use this - * identifier and the volume serial number to determine whether two - * handles refer to the same file. + /* Files in windows are uniquely identified by the volume serial + * number and the file index (both low and high parts). + * + * There are caveats where these numbers can change, especially + * on FAT file systems. On NTFS, however, a file should keep + * those numbers the same until renamed or deleted (though you + * can use ReplaceFile() on NTFS to keep the numbers the same + * while renaming). + * + * See the MSDN "BY_HANDLE_FILE_INFORMATION Structure" entry for + * more information. + * + * http://msdn.microsoft.com/en-us/library/aa363788(v=VS.85).aspx */ - DWORD fileindexlo; - DWORD fileindexhi; -#endif + DWORD nFileIndexLow; + DWORD nFileIndexHigh; + DWORD dwVolumeSerialNumber; + + HANDLE hFile; /* Native windows file handle */ +#endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /*changes not saved? */ } H5FD_core_t; @@ -89,8 +112,7 @@ typedef struct H5FD_core_fapl_t { /* Allocate memory in multiples of this size by default */ #define H5FD_CORE_INCREMENT 8192 -/* - * These macros check for overflow of various quantities. These macros +/* These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' @@ -200,8 +222,6 @@ H5FD_core_init_interface(void) * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ hid_t @@ -258,15 +278,6 @@ H5FD_core_term(void) * Programmer: Robb Matzke * Thursday, February 19, 1998 * - * Modifications: - * Robb Matzke, 1999-10-19 - * Added the BACKING_STORE argument. If set then the entire file - * contents are flushed to a file with the same name as this - * core file. - * - * Raymond Lu, 2001-10-25 - * Changed the file access list to the new generic list. - * *------------------------------------------------------------------------- */ herr_t @@ -305,14 +316,6 @@ done: * Programmer: Robb Matzke * Tuesday, August 10, 1999 * - * Modifications: - * Robb Matzke, 1999-10-19 - * Added the BACKING_STORE argument. - * - * Raymond Lu - * 2001-10-25 - * Changed file access list to the new generic property list. - * *------------------------------------------------------------------------- */ herr_t @@ -355,8 +358,6 @@ done: * Programmer: Robb Matzke * Friday, August 13, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static void * @@ -396,16 +397,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Robb Matzke, 1999-10-19 - * The backing store file is created and opened if specified. - * - * Raymond Lu, 2006-11-30 - * Enabled the driver to read an existing file depending on - * the setting of the backing_store and file open flags. - * - * Allen Byrne, 2008-1-23 - * changed if of fapl_id to assert *------------------------------------------------------------------------- */ static H5FD_t * @@ -417,7 +408,6 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_core_fapl_t *fa=NULL; H5P_genplist_t *plist; /* Property list pointer */ #ifdef H5_HAVE_WIN32_API - HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; #endif h5_stat_t sb; @@ -461,8 +451,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, if(name && *name) file->name = H5MM_xstrdup(name); - /* - * The increment comes from either the file access property list or the + /* The increment comes from either the file access property list or the * default value. But if the file access property list was zero then use * the default value instead. */ @@ -474,10 +463,16 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, if(fd >= 0) { /* Retrieve information for determining uniqueness of file */ #ifdef H5_HAVE_WIN32_API - filehandle = _get_osfhandle(fd); - (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); - file->fileindexhi = fileinfo.nFileIndexHigh; - file->fileindexlo = fileinfo.nFileIndexLow; + file->hFile = (HANDLE)_get_osfhandle(fd); + if(INVALID_HANDLE_VALUE == file->hFile) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file handle") + + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to get Windows file information") + + file->nFileIndexHigh = fileinfo.nFileIndexHigh; + file->nFileIndexLow = fileinfo.nFileIndexLow; + file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; #else /* H5_HAVE_WIN32_API */ file->device = sb.st_dev; #ifdef H5_VMS @@ -496,7 +491,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, size_t size; /* Retrieve file size */ - size = (size_t)sb.st_size; + size = (size_t)sb.st_size; /* Check if we should allocate the memory buffer and read in existing data */ if(size) { @@ -507,9 +502,40 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, /* Set up data structures */ file->eof = size; - /* Read in existing data */ - if(HDread(file->fd, file->mem, size) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read file") + /* Read in existing data, being careful of interrupted system calls, + * partial results, and the end of the file. + */ + while(size > 0) { + + h5_core_io_t bytes_in = 0; /* # of bytes to read */ + h5_core_io_ret_t bytes_read = -1; /* # of bytes actually read */ + + /* Trying to read more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_CORE_MAX_IO_BYTES_g) + bytes_in = H5_CORE_MAX_IO_BYTES_g; + else + bytes_in = (h5_core_io_t)size; + + do { + bytes_read = HDread(file->fd, file->mem, bytes_in); + } while(-1 == bytes_read && EINTR == errno); + + if(-1 == bytes_read) { /* error */ + int myerrno = errno; + time_t mytime = HDtime(NULL); + HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, size = %lu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long)size, (unsigned long long)myoffset); + } /* end if */ + + HDassert(bytes_read >= 0); + HDassert((size_t)bytes_read <= size); + + size -= (size_t)bytes_read; + + } /* end while */ } /* end if */ } /* end if */ @@ -578,13 +604,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Neil Fortner - * Tuesday, March 9, 2010 - * Modified function to compare low level file information if - * a backing store is opened for both files, similar to the - * sec2 file driver. - * *------------------------------------------------------------------------- */ static int @@ -599,11 +618,14 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) if(f1->fd >= 0 && f2->fd >= 0) { /* Compare low level file information for backing store */ #ifdef H5_HAVE_WIN32_API - if (f1->fileindexhi < f2->fileindexhi) HGOTO_DONE(-1) - if (f1->fileindexhi > f2->fileindexhi) HGOTO_DONE(1) + if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) HGOTO_DONE(-1) + if(f1->dwVolumeSerialNumber > f2->dwVolumeSerialNumber) HGOTO_DONE(1) - if (f1->fileindexlo < f2->fileindexlo) HGOTO_DONE(-1) - if (f1->fileindexlo > f2->fileindexlo) HGOTO_DONE(1) + if(f1->nFileIndexHigh < f2->nFileIndexHigh) HGOTO_DONE(-1) + if(f1->nFileIndexHigh > f2->nFileIndexHigh) HGOTO_DONE(1) + + if(f1->nFileIndexLow < f2->nFileIndexLow) HGOTO_DONE(-1) + if(f1->nFileIndexLow > f2->nFileIndexLow) HGOTO_DONE(1) #else #ifdef H5_DEV_T_IS_SCALAR @@ -702,11 +724,6 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) * Programmer: Robb Matzke * Monday, August 2, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t @@ -734,11 +751,6 @@ H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static herr_t @@ -775,8 +787,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t @@ -800,8 +810,6 @@ H5FD_core_get_eof(const H5FD_t *_file) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -867,8 +875,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ /* ARGSUSED */ @@ -881,8 +887,8 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd FUNC_ENTER_NOAPI_NOINIT - assert(file && file->pub.cls); - assert(buf); + HDassert(file && file->pub.cls); + HDassert(buf); /* Check for overflow conditions */ if (HADDR_UNDEF == addr) @@ -934,8 +940,6 @@ done: * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ /* ARGSUSED */ @@ -1005,10 +1009,6 @@ done: * Programmer: Robb Matzke * Friday, October 15, 1999 * - * Modifications: - * Raymond Lu, 2006-11-30 - * Added a condition check for backing store flag, for an - * existing file can be opened for read and write now. *------------------------------------------------------------------------- */ /* ARGSUSED */ @@ -1027,19 +1027,40 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) if (0!=HDlseek(file->fd, (off_t)0, SEEK_SET)) HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "error seeking in backing store") + + while (size > 0) { - while (size) { - ssize_t n; - - H5_CHECK_OVERFLOW(size,hsize_t,size_t); - n = HDwrite(file->fd, ptr, (size_t)size); - if (n<0 && EINTR==errno) - continue; - if (n<0) - HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "error writing backing store") - ptr += (size_t)n; - size -= (size_t)n; - } + h5_core_io_t bytes_in = 0; /* # of bytes to write */ + h5_core_io_ret_t bytes_wrote = -1; /* # of bytes written */ + + /* Trying to write more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_CORE_MAX_IO_BYTES_g) + bytes_in = H5_CORE_MAX_IO_BYTES_g; + else + bytes_in = (h5_core_io_t)size; + + do { + bytes_wrote = HDwrite(file->fd, ptr, bytes_in); + } while(-1 == bytes_wrote && EINTR == errno); + + if(-1 == bytes_wrote) { /* error */ + int myerrno = errno; + time_t mytime = HDtime(NULL); + HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "write to backing store failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', ptr = %p, size = %lu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), ptr, (unsigned long)size, (unsigned long long)myoffset); + } /* end if */ + + HDassert(bytes_wrote > 0); + HDassert((size_t)bytes_wrote <= size); + + size -= (size_t)bytes_wrote; + ptr = (unsigned char *)ptr + bytes_wrote; + + } /* end while */ + file->dirty = FALSE; } @@ -1094,6 +1115,43 @@ if(file->eof < new_eof) /* Update backing store, if using it */ if(file->fd >= 0 && file->backing_store) { +#ifdef H5_HAVE_WIN32_API + LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ + DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() + * Only used as an error code here. + */ + DWORD dwError; /* DWORD error code from GetLastError() */ + BOOL bError; /* Boolean error flag */ + + /* Windows uses this odd QuadPart union for 32/64-bit portability */ + li.QuadPart = (__int64)file->eoa; + + /* Extend the file to make sure it's large enough. + * + * Since INVALID_SET_FILE_POINTER can technically be a valid return value + * from SetFilePointer(), we also need to check GetLastError(). + */ + dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); + if(INVALID_SET_FILE_POINTER == dwPtrLow) { + dwError = GetLastError(); + if(dwError != NO_ERROR ) + HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") + } + + bError = SetEndOfFile(file->hFile); + if(0 == bError) + HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") +#else /* H5_HAVE_WIN32_API */ +#ifdef H5_VMS + /* Reset seek offset to the beginning of the file, so that the file isn't + * re-extended later. This may happen on Open VMS. */ + if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") +#endif + if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") +#endif /* H5_HAVE_WIN32_API */ + #ifdef H5_VMS /* Reset seek offset to the beginning of the file, so that the file isn't * re-extended later. This may happen on Open VMS. */ @@ -1112,4 +1170,3 @@ if(file->eof < new_eof) done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_core_truncate() */ - -- cgit v0.12 From daef205d04464c96d933727d1e97378cbfe094cf Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Thu, 22 Mar 2012 14:31:01 -0500 Subject: [svn-r22122] Issue 7785 - Writing or reading many small chunks ran out of memory and caused seg fault. I added checks in two places to make sure the library returns error stack when it fails to allocate memory. I didn't add any test to the test suite since there is no good way to test it. But I tested and verified the error stack by hand. Tested on jam, koala, ostrich. --- src/H5Dchunk.c | 2 +- src/H5Dio.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 46925a1..af888a9 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -974,7 +974,7 @@ H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) H5S_select_all(chunk_info->fspace, TRUE); /* Close the chunk's memory dataspace, if it's not shared */ - if(!chunk_info->mspace_shared) + if(!chunk_info->mspace_shared && chunk_info->mspace) (void)H5S_close(chunk_info->mspace); /* Free the actual chunk info */ diff --git a/src/H5Dio.c b/src/H5Dio.c index 248ea9e..ef826fe 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -657,6 +657,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #endif /*H5_HAVE_PARALLEL*/ /* Call storage method's I/O initialization routine */ + HDmemset(&fm, 0, sizeof(H5D_chunk_map_t)); if(io_info.layout_ops.io_init && (*io_info.layout_ops.io_init)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info") io_op_init = TRUE; -- cgit v0.12 From c9f0f2ec22961b297d615c2deac0ce4b52a07b96 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 22 Mar 2012 17:21:37 -0500 Subject: [svn-r22126] Fixes for Component installation --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fe8a5f8..5543b48 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -919,6 +919,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_PACKAGE_VENDOR "HDF Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}") + SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_NAME}-${HDF5_PACKAGE_VERSION}-${LIB_TYPE}") SET (CPACK_PACKAGE_VERSION "${HDF5_PACKAGE_VERSION}") SET (CPACK_PACKAGE_VERSION_MAJOR "${HDF5_PACKAGE_VERSION_MAJOR}") SET (CPACK_PACKAGE_VERSION_MINOR "${HDF5_PACKAGE_VERSION_MINOR}") @@ -935,8 +936,9 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") ELSE (WIN32) SET (CPACK_RPM_COMPONENT_INSTALL ON) + SET (CPACK_ARCHIVE_COMPONENT_INSTALL ON) + SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) ENDIF (WIN32) - SET (CPACK_MONOLITHIC_INSTALL ON) INCLUDE(InstallRequiredSystemLibraries) -- cgit v0.12 From 19a6303205d070f62f2579168397579001a38fe5 Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Thu, 22 Mar 2012 19:50:36 -0500 Subject: [svn-r22128] Purpose: Fixed bug 4279 Description: Closed various HDF5 objects in DataSet::getInMemDataSize and Attribute::getInMemDataSize to remove some memory leaks. Platforms tested: Linux/32 2.6 (jam) Linux/64 2.6 (amani) SunOS 5.10 (linew) --- c++/src/H5Attribute.cpp | 24 ++++++++++++++-- c++/src/H5DataSet.cpp | 24 ++++++++++++++-- c++/test/dsets.cpp | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 117 insertions(+), 6 deletions(-) diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index dad347f..84826c4 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -198,7 +198,7 @@ void Attribute::read(const DataType& mem_type, H5std_string& strg) const //-------------------------------------------------------------------------- size_t Attribute::getInMemDataSize() const { - char *func = "Attribute::getInMemDataSize"; + const char *func = "Attribute::getInMemDataSize"; // Get the data type of this attribute hid_t mem_type_id = H5Aget_type(id); @@ -207,7 +207,8 @@ size_t Attribute::getInMemDataSize() const throw AttributeIException(func, "H5Aget_type failed"); } - // Get the data type's size + // Get the data type's size by first getting its native type then getting + // the native type's size. hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { @@ -219,7 +220,18 @@ size_t Attribute::getInMemDataSize() const throw AttributeIException(func, "H5Tget_size failed"); } - // Get number of elements of the attribute + // Close the native type and the datatype of this attribute. + if (H5Tclose(native_type) < 0) + { + throw DataSetIException(func, "H5Tclose(native_type) failed"); + } + if (H5Tclose(mem_type_id) < 0) + { + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + } + + // Get number of elements of the attribute by first getting its dataspace + // then getting the number of elements in the dataspace hid_t space_id = H5Aget_space(id); if (space_id < 0) { @@ -231,6 +243,12 @@ size_t Attribute::getInMemDataSize() const throw AttributeIException(func, "H5Sget_simple_extent_npoints failed"); } + // Close the dataspace + if (H5Sclose(space_id) < 0) + { + throw DataSetIException(func, "H5Sclose failed"); + } + // Calculate and return the size of the data size_t data_size = type_size * num_elements; return(data_size); diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 7351bbf..f73be0f 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -238,7 +238,8 @@ size_t DataSet::getInMemDataSize() const throw DataSetIException(func, "H5Dget_type failed"); } - // Get the data type's size + // Get the data type's size by first getting its native type then getting + // the native type's size. hid_t native_type = H5Tget_native_type(mem_type_id, H5T_DIR_DEFAULT); if (native_type < 0) { @@ -250,8 +251,19 @@ size_t DataSet::getInMemDataSize() const throw DataSetIException(func, "H5Tget_size failed"); } - // Get number of elements of the dataset - hid_t space_id = H5Dget_space(id); // first get its data space + // Close the native type and the datatype of this dataset. + if (H5Tclose(native_type) < 0) + { + throw DataSetIException(func, "H5Tclose(native_type) failed"); + } + if (H5Tclose(mem_type_id) < 0) + { + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + } + + // Get number of elements of the dataset by first getting its dataspace, + // then getting the number of elements in the dataspace + hid_t space_id = H5Dget_space(id); if (space_id < 0) { throw DataSetIException(func, "H5Dget_space failed"); @@ -262,6 +274,12 @@ size_t DataSet::getInMemDataSize() const throw DataSetIException(func, "H5Sget_simple_extent_npoints failed"); } + // Close the dataspace + if (H5Sclose(space_id) < 0) + { + throw DataSetIException(func, "H5Sclose failed"); + } + // Calculate and return the size of the data size_t data_size = type_size * num_elements; return(data_size); diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index ee1a206..26abace 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -268,6 +268,77 @@ test_simple_io( H5File& file) } // test_simple_io /*------------------------------------------------------------------------- + * Function: test_datasize + * + * Purpose: Tests DataSet::getInMemDataSize(). + * + * Return: Success: 0 + * + * Failure: -1 + * + * Programmer: Binh-Minh Ribler + * Thursday, March 22, 2012 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +test_datasize() +{ + + SUBTEST("DataSet::getInMemDataSize()"); + + int points[100][200]; + int check[100][200]; + int i, j, n; + + try + { + // Open FILE1. + H5File file(FILE1, H5F_ACC_RDWR, FileCreatPropList::DEFAULT, FileAccPropList::DEFAULT); + + // Open dataset DSET_SIMPLE_IO_NAME. + DataSet dset = file.openDataSet (DSET_SIMPLE_IO_NAME); + + // Get the dataset's dataspace to calculate the size for verification. + DataSpace space(dset.getSpace()); + + // Get the dimension sizes. + hsize_t dims[2]; + int n_dims = space.getSimpleExtentDims(dims); + + // Calculate the supposed size. Size of each value is int (4), from + // test_simple_io. + int expected_size = 4 * dims[0] * dims[1]; + + // getInMemDataSize() returns the in memory size of the data. + size_t ds_size = dset.getInMemDataSize(); + + // Verify the data size. + if (ds_size != expected_size) + { + H5_FAILED(); + cerr << " Expected data size = " << expected_size; + cerr << " but dset.getInMemDataSize() returned " << ds_size << endl; + throw Exception("test_compression", "Failed in testing DataSet::getInMemDataSize()"); + } + + PASSED(); + return 0; + } // end try + + // catch all dataset, space, plist exceptions + catch (Exception E) + { + cerr << " FAILED" << endl; + cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; + + return -1; + } +} // test_datasize + +/*------------------------------------------------------------------------- * Function: test_tconv * * Purpose: Test some simple data type conversion stuff. @@ -1004,6 +1075,10 @@ void test_dset() nerrors += test_compression(file)<0 ?1:0; nerrors += test_multiopen (file)<0 ?1:0; nerrors += test_types(file)<0 ?1:0; + + // Close the file before testing data size. + file.close(); + nerrors += test_datasize() <0 ? 1:0; } catch (Exception E) { -- cgit v0.12 From 213ab6eb36e398b5d0db55df002875ffcdeb4122 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 22 Mar 2012 23:18:59 -0500 Subject: [svn-r22129] HDFFV-7777: Fix for removing NULL character from fortran string in h5lt_get_attribute_string_f Fixed size +1 error in HD5f2cstring --- hl/fortran/src/H5DSfc.c | 4 ++-- hl/fortran/src/H5LTf90proto.h | 3 ++- hl/fortran/src/H5LTfc.c | 32 +++++++++++++++++++------------- hl/fortran/src/H5LTff.f90 | 14 ++++++++++---- 4 files changed, 33 insertions(+), 20 deletions(-) diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c index 6816347..3135cfa 100755 --- a/hl/fortran/src/H5DSfc.c +++ b/hl/fortran/src/H5DSfc.c @@ -283,7 +283,7 @@ nh5dsget_label_c(hid_t_f *did, int_f *idx, _fcd label, size_t_f *size) * Convert C name to FORTRAN and place it in the given buffer */ - HD5packFstring(c_label, _fcdtocp(label), (size_t)*size+1); + HD5packFstring(c_label, _fcdtocp(label), (size_t)*size); done: *size = (size_t_f)size_c; /* Don't subtract '1' because H5DSget_label doesn't include the @@ -332,7 +332,7 @@ nh5dsget_scale_name_c(hid_t_f *did, _fcd name, size_t_f *size) * Convert C name to FORTRAN and place it in the given buffer */ if(size_c != 0) { - HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size+1); + HD5packFstring(c_scale_name, _fcdtocp(name), (size_t)*size); *size = (size_t_f)size_c-1; /* (-1) because we don't include the NULL ending in the length*/ } else { *size = (size_t_f)size_c; /* if NULL then no name was found */ diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 205871c..8618fc6 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -1140,7 +1140,8 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, _fcd dsetname, int_f *attrnamelen, _fcd attrname, - void *buf); + _fcd buf, + size_t_f *buf_size); HDF5_HL_F90CSTUBDLL int_f diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index c0b7695..674636d 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -17,8 +17,7 @@ #include "H5LTprivate.h" #include "H5LTf90proto.h" - - +#include "H5Eprivate.h" /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_c @@ -1719,13 +1718,13 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, _fcd dsetname, int_f *attrnamelen, _fcd attrname, - void *buf) + _fcd buf, size_t_f *buf_size) { int ret_value = -1; herr_t ret; - hid_t c_loc_id; char *c_name = NULL; char *c_attrname = NULL; + char *c_buf = NULL; int c_namelen; int c_attrnamelen; @@ -1741,26 +1740,33 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) goto done; - /* - * Call H5LTget_attribute_int function. - */ - c_loc_id = (hid_t)*loc_id; - - ret = H5LTget_attribute_string(c_loc_id,c_name,c_attrname,buf); + * Allocate buffer to hold C attribute string + */ + if ((c_buf = HDmalloc((size_t)*buf_size + 1)) == NULL) + goto done; + /* + * Call H5LTget_attribute_int function. + */ + ret = H5LTget_attribute_string((hid_t)*loc_id,c_name,c_attrname,c_buf); if (ret < 0) goto done; - ret_value = 0; + /* + * Convert C name to FORTRAN and place it in the given buffer + */ + HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*buf_size); + ret_value = 0; done: if(c_name!=NULL) free(c_name); if(c_attrname!=NULL) free(c_attrname); - + if(c_buf!=NULL) + free(c_buf); return ret_value; } @@ -2157,7 +2163,7 @@ nh5ltpath_valid_c(hid_t_f *loc_id, /* * convert FORTRAN name to C name */ - if( NULL == (c_path = (char *)HD5f2cstring(path, (int)*pathlen))) + if( NULL == (c_path = (char *)HD5f2cstring(path, (size_t)*pathlen))) goto done; check_object_valid = FALSE; diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index 7d53ab7..b384821 100755 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -5969,9 +5969,10 @@ CONTAINS CHARACTER(len=*), INTENT(inout) :: buf ! data buffer INTEGER :: namelen ! name length INTEGER :: attrlen ! name length + INTEGER(size_t) :: buf_size ! buf size INTERFACE - INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + INTEGER FUNCTION h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) USE h5global !DEC$IF DEFINED(HDF5F90_WINDOWS) !DEC$ATTRIBUTES C,reference,decorate,alias:'H5LTGET_ATTRIBUTE_STRING_C'::h5ltget_attribute_string_c @@ -5984,12 +5985,15 @@ CONTAINS CHARACTER(len=*), INTENT(in) :: dset_name ! name of the dataset CHARACTER(len=*), INTENT(in) :: attr_name ! name of the attribute CHARACTER(len=*), INTENT(inout) :: buf ! data buffer + INTEGER(size_t) :: buf_size ! data buffer size END FUNCTION h5ltget_attribute_string_c END INTERFACE namelen = LEN(dset_name) attrlen = LEN(attr_name) - errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf) + buf_size = LEN(buf) + + errcode = h5ltget_attribute_string_c(loc_id,namelen,dset_name,attrlen,attr_name,buf,buf_size) END SUBROUTINE h5ltget_attribute_string_f @@ -6360,14 +6364,16 @@ CONTAINS END FUNCTION h5ltpath_valid_c END INTERFACE + ! Initialize + path_valid = .FALSE. + errcode = 0 + check_object_valid_c = 0 IF(check_object_valid) check_object_valid_c = 1 pathlen = LEN(path) status = h5ltpath_valid_c(loc_id, path, pathlen, check_object_valid_c) - path_valid = .FALSE. - errcode = 0 IF(status.EQ.1)THEN path_valid = .TRUE. ELSE IF(status.LT.0)THEN -- cgit v0.12 From 38a1ea7b99f61d07b667c6772ea6e998a7327013 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 22 Mar 2012 23:20:51 -0500 Subject: [svn-r22130] Test for HDFFV-7777 h5ltget_attribure_string_f added Added check that HLDS fortran function do remove NULL character. --- hl/fortran/test/tstds.f90 | 10 +++++++-- hl/fortran/test/tstlite.f90 | 53 ++++++++++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/hl/fortran/test/tstds.f90 b/hl/fortran/test/tstds.f90 index 8817989..c73e1c4 100644 --- a/hl/fortran/test/tstds.f90 +++ b/hl/fortran/test/tstds.f90 @@ -186,7 +186,10 @@ SUBROUTINE test_testds(err) name_len = 25 name = '' CALL H5DSget_scale_name_f(dsid, name, name_len, err) - IF(err.LT.0.OR.name_len.NE.21.OR.TRIM(name).NE."Dimension Scale Set 1")THEN + IF(err.LT.0 .OR. & + name_len.NE.21 .OR. & + TRIM(name).NE."Dimension Scale Set 1" .OR. & + name(22:25).NE.' ')THEN err = FAILED CALL write_test_status(err) RETURN @@ -293,7 +296,10 @@ SUBROUTINE test_testds(err) label_len = 25 label = '' CALL H5DSget_label_f(did, DIM2, label, label_len, err) - IF(err.LT.0.OR.label(1:label_len).NE."Label12".OR.label_len.NE.7)THEN + IF(err.LT.0.OR. & + label(1:label_len).NE."Label12" .OR. & + label_len.NE.7 .OR. & + label(8:25).NE.' ')THEN err = FAILED CALL write_test_status(err) RETURN diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index 9329dba..50be69e 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -1342,7 +1342,9 @@ SUBROUTINE test_attributes() IMPLICIT NONE CHARACTER(len=9), PARAMETER :: filename = "dsetf5.h5"! File name + CHARACTER(len=9), PARAMETER :: filename1 ="tattr.h5" ! C written attribute file INTEGER(HID_T) :: file_id ! File identifier + INTEGER(HID_T) :: file_id1 INTEGER, PARAMETER :: DIM1 = 10; ! Dimension of array CHARACTER(LEN=5), PARAMETER :: attrname1 = "attr1" ! Attribute name CHARACTER(LEN=5), PARAMETER :: attrname2 = "attr2" ! Attribute name @@ -1350,9 +1352,11 @@ SUBROUTINE test_attributes() CHARACTER(LEN=5), PARAMETER :: attrname4 = "attr4" ! Attribute name CHARACTER(LEN=5), PARAMETER :: attrname5 = "attr5" ! Attribute name CHARACTER(LEN=8), PARAMETER :: buf1 = "mystring" ! Data buffer + CHARACTER(LEN=16), PARAMETER :: buf_c = "string attribute" CHARACTER(LEN=8) :: bufr1 ! Data buffer CHARACTER(LEN=10) :: bufr1_lg ! Data buffer - CHARACTER(LEN=6) :: bufr1_sm ! Data buffer + CHARACTER(LEN=16) :: bufr_c ! Data buffer + CHARACTER(LEN=18) :: bufr_c_lg ! Data buffer INTEGER, DIMENSION(DIM1) :: buf2 ! Data buffer INTEGER, DIMENSION(DIM1) :: bufr2 ! Data buffer REAL, DIMENSION(DIM1) :: buf3 ! Data buffer @@ -1370,6 +1374,7 @@ SUBROUTINE test_attributes() INTEGER :: rank = 1 ! Dataset rank CHARACTER(LEN=5), PARAMETER :: dsetname1 = "dset1" ! Dataset name INTEGER, DIMENSION(DIM1) :: buf ! Data buffer + ! ! Initialize FORTRAN predefined datatypes. @@ -1488,15 +1493,12 @@ SUBROUTINE test_attributes() CALL passed() - - !------------------------------------------------------------------------- ! string !------------------------------------------------------------------------- CALL test_begin(' Set/Get attributes string ') - ! ! write attribute. ! @@ -1530,19 +1532,36 @@ SUBROUTINE test_attributes() STOP ENDIF - ! - ! read attribute into a fortran character buf that is smaller then buf1. - ! - CALL h5ltget_attribute_string_f(file_id,dsetname1,attrname5,bufr1_sm,errcode) - - ! - ! compare read and write buffers. - ! - IF ( buf1(1:6) .NE. bufr1_sm(1:6) ) THEN - PRINT *, 'smaller read buffer differs from write buffer' - PRINT *, buf1, ' and ', bufr1_sm - STOP - ENDIF + ! + ! ** Test reading a string that was created with a C program ** + ! + +!!$ CALL h5fopen_f(filename1, H5F_ACC_RDONLY_F, file_id1, errcode) +!!$ +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c, errcode) +!!$ ! +!!$ ! compare read and write buffers. +!!$ ! +!!$ IF ( bufr_c .NE. buf_c ) THEN +!!$ PRINT *, 'read buffer differs from write buffer' +!!$ PRINT *, bufr1, ' and ', buf_c +!!$ STOP +!!$ ENDIF +!!$ ! +!!$ ! read attribute into a fortran character buf that is larger then buf_c. +!!$ ! +!!$ CALL h5ltget_attribute_string_f(file_id1, "/", "attr5", bufr_c_lg, errcode) +!!$ +!!$ ! +!!$ ! compare read and write buffers, make sure C NULL character was removed. +!!$ ! +!!$ IF ( buf_c(1:16) .NE. bufr_c_lg(1:16) .AND. bufr_c_lg(17:18) .NE. ' ' ) THEN +!!$ PRINT *, 'larger read buffer differs from write buffer' +!!$ PRINT *, buf_c, ' and ', bufr_c_lg +!!$ STOP +!!$ ENDIF + + CALL h5fclose_f(file_id1, errcode) CALL passed() -- cgit v0.12 From 3682dd9ae06c20eea700994e0b4c49c3e29b1448 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 23 Mar 2012 09:25:05 -0500 Subject: [svn-r22133] Description: fixed problem with closing a non-existing file id. Tested: koala (gnu 4.1) --- hl/fortran/test/tstlite.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/fortran/test/tstlite.f90 b/hl/fortran/test/tstlite.f90 index 50be69e..0b5a138 100644 --- a/hl/fortran/test/tstlite.f90 +++ b/hl/fortran/test/tstlite.f90 @@ -1561,7 +1561,7 @@ SUBROUTINE test_attributes() !!$ STOP !!$ ENDIF - CALL h5fclose_f(file_id1, errcode) +!!$ CALL h5fclose_f(file_id1, errcode) CALL passed() -- cgit v0.12 From 97483389cbaee7033622f2de3b844e8bc3a59054 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 23 Mar 2012 10:45:39 -0500 Subject: [svn-r22134] Issue 7785 - follow-up checkin. I forgot to initialize a structure in H5D_read as I did in H5D_write. Tested on jam - simple change. --- src/H5Dio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Dio.c b/src/H5Dio.c index ef826fe..06e4417 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -434,6 +434,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, || dataset->shared->layout.type == H5D_COMPACT); /* Call storage method's I/O initialization routine */ + HDmemset(&fm, 0, sizeof(H5D_chunk_map_t)); if(io_info.layout_ops.io_init && (*io_info.layout_ops.io_init)(&io_info, &type_info, nelmts, file_space, mem_space, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize I/O info") io_op_init = TRUE; -- cgit v0.12 From 1116fc1e5e0cf48193726bc445079810dc1176fc Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Fri, 23 Mar 2012 11:09:08 -0500 Subject: [svn-r22135] I added an item for Issue 7785. No test is needed. --- release_docs/RELEASE.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index f0f296c..899dc83 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -368,6 +368,10 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - When an application tries to write or read many small data chunks and + runs out of memory, the library had a seg fault. The fix is to + return the error stack with proper information. (SLU - 2012/3/23. + Issue 7785) - H5Pset_data_transform had seg fault in some cases like x*-100. It works correctly now and handles other cases like 100-x or 2/x. (SLU - 2012/3/15. Issue 7922) -- cgit v0.12 From ec04239a6f2b6f217b606e6b2fb92650b2c19731 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 23 Mar 2012 16:05:22 -0500 Subject: [svn-r22136] Purpose: update for HDFFV-7837 - h5diff: incorrect behavior with exclude-path option when unique object exist only in one file Description: Add the new test output list to test shell script. This is based on the previous commit r22114. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE) --- tools/h5diff/testh5diff.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 27fb253..3eb3306 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -212,6 +212,9 @@ $SRC_H5DIFF_TESTFILES/h5diff_481.txt $SRC_H5DIFF_TESTFILES/h5diff_482.txt $SRC_H5DIFF_TESTFILES/h5diff_483.txt $SRC_H5DIFF_TESTFILES/h5diff_484.txt +$SRC_H5DIFF_TESTFILES/h5diff_485.txt +$SRC_H5DIFF_TESTFILES/h5diff_486.txt +$SRC_H5DIFF_TESTFILES/h5diff_487.txt $SRC_H5DIFF_TESTFILES/h5diff_50.txt $SRC_H5DIFF_TESTFILES/h5diff_51.txt $SRC_H5DIFF_TESTFILES/h5diff_52.txt -- cgit v0.12 From 1e0306a7c9d0c52228e1544ff9251b3287f8e38e Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Sat, 24 Mar 2012 22:18:31 -0500 Subject: [svn-r22138] Add check for valid number of children in H5B_decode(). See HDFFV-5897. Tested: jam, durandal (too minor for full h5committest) --- src/H5Bcache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/H5Bcache.c b/src/H5Bcache.c index c0fd121..68fb920 100644 --- a/src/H5Bcache.c +++ b/src/H5Bcache.c @@ -152,6 +152,10 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_udata) /* entries used */ UINT16DECODE(p, bt->nchildren); + /* Check if bt->nchildren is greater than two_k */ + if(bt->nchildren > shared->two_k) + HGOTO_ERROR(H5E_BTREE, H5E_BADVALUE, NULL, "number of children is greater than maximum") + /* sibling pointers */ H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->left)); H5F_addr_decode(udata->f, (const uint8_t **)&p, &(bt->right)); -- cgit v0.12 From cdc63fc21a4405c6da9473102216b2c2c1bc3887 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 25 Mar 2012 09:30:39 -0500 Subject: [svn-r22140] Snapshot version 1.9 release 112 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5Fmpi.c | 4 ++-- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 15 files changed, 32 insertions(+), 32 deletions(-) diff --git a/README.txt b/README.txt index 1934e39..cb4a1c5 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.112 currently under development +HDF5 version 1.9.113 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 159bbf6..3f99980 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index daf5dc6..c492a0c 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index c6f46b2..ecaef5a 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22040 2012-03-11 15:52:04Z hdftest . +# From configure.in Id: configure.in 22097 2012-03-20 13:00:55Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.112. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.113. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.112' -PACKAGE_STRING='HDF5 1.9.112' +PACKAGE_VERSION='1.9.113' +PACKAGE_STRING='HDF5 1.9.113' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.112 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.113 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.112:";; + short | recursive ) echo "Configuration of HDF5 1.9.113:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.112 +HDF5 configure 1.9.113 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.112, which was +It was created by HDF5 $as_me 1.9.113, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.112' + VERSION='1.9.113' cat >>confdefs.h <<_ACEOF @@ -30611,7 +30611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.112, which was +This file was extended by HDF5 $as_me 1.9.113, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30677,7 +30677,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.112 +HDF5 config.status 1.9.113 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33471,7 +33471,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.112 +HDF5 config.lt 1.9.113 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 6be679a..8854177 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.112], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.113], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 35fafee..c963c83 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 6dae65a..af3203d 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 62d7309..e9ec78f 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2623b3a..4519dc8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 899dc83..d4ff01d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.112 currently under development +HDF5 version 1.9.113 currently under development ================================================================================ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 0f612be..966528a 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -202,7 +202,7 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "iMi", file_id, flag); + H5TRACE2("e", "ib", file_id, flag); /* Check args */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) @@ -242,7 +242,7 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag) herr_t ret_value = SUCCEED; FUNC_ENTER_API(FAIL) - H5TRACE2("e", "iMi", file_id, flag); + H5TRACE2("e", "i*b", file_id, flag); /* Check args */ if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) diff --git a/src/H5public.h b/src/H5public.h index 1f44ff3..0f9edfb 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 112 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 113 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.112" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.113" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 64e5cdc..53c06c5 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 102 +LT_VERS_REVISION = 103 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 4a2d8c4..e38f4df 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.112" +#define H5_PACKAGE_STRING "HDF5 1.9.113" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.112" +#define H5_PACKAGE_VERSION "1.9.113" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.112" +#define H5_VERSION "1.9.113" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index ade2790..f7366ee 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.112" +#define H5_PACKAGE_STRING "HDF5 1.9.113" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.112" +#define H5_PACKAGE_VERSION "1.9.113" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.112" +#define H5_VERSION "1.9.113" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From e002bb98e17c3502bedd9660d72387da6a662cc2 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 25 Mar 2012 23:12:59 -0500 Subject: [svn-r22142] Description : New Fortran wrapper (h5ocopy_f) for the C API H5Ocopy HDFFV-7965 Tested: jam (gnu), koala (gnu) --- fortran/src/H5Of.c | 57 ++++++++++++++++++++++++++++++++++++++ fortran/src/H5Off.f90 | 72 ++++++++++++++++++++++++++++++++++++++++++++++++ fortran/src/H5f90proto.h | 7 ++++- fortran/test/tH5O.f90 | 53 +++++++++++++++++++++++++++++++++-- 4 files changed, 186 insertions(+), 3 deletions(-) diff --git a/fortran/src/H5Of.c b/fortran/src/H5Of.c index 0df433a..531f09c 100644 --- a/fortran/src/H5Of.c +++ b/fortran/src/H5Of.c @@ -334,3 +334,60 @@ nh5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f * return ret_value; } +/* ***if* H5Of/H5Ocopy_c + * NAME + * H5Ocopy_c + * PURPOSE + * Calls H5Ocopy + * INPUTS + * src_loc_id - Object identifier indicating the location of the source object to be copied + * src_name - Name of the source object to be copied + * src_name_len - Length of src_name + * dst_loc_id - Location identifier specifying the destination + * dst_name - Name to be assigned to the new copy + * dst_name_len - Length of dst_name + * ocpypl_id - Object copy property list + * lcpl_id - Link creation property list for the new hard link + * + * RETURNS + * 0 on success, -1 on failure + * AUTHOR + * M. Scot Breitenfeld + * March 14, 2012 + * SOURCE +*/ +int_f +nh5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *ocpypl_id, hid_t_f *lcpl_id ) +/******/ +{ + char *c_src_name = NULL; /* Buffer to hold C string */ + char *c_dst_name = NULL; /* Buffer to hold C string */ + + int_f ret_value = 0; /* Return value */ + + /* + * Convert FORTRAN name to C name + */ + if((c_src_name = HD5f2cstring(src_name, (size_t)*src_name_len)) == NULL) + HGOTO_DONE(FAIL); + if((c_dst_name = HD5f2cstring(dst_name, (size_t)*dst_name_len)) == NULL) + HGOTO_DONE(FAIL); + + /* + * Call H5Ocopy function. + */ + if(H5Ocopy( (hid_t)*src_loc_id, c_src_name, (hid_t)*dst_loc_id, c_dst_name, + (hid_t)*ocpypl_id, (hid_t)*lcpl_id) < 0) + HGOTO_DONE(FAIL); + + done: + if(c_src_name) + HDfree(c_src_name); + if(c_dst_name) + HDfree(c_dst_name); + + return ret_value; + +} diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index e69fdb5..04c96e2 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -250,5 +250,77 @@ CONTAINS END SUBROUTINE h5oopen_by_addr_f +! +!****s* H5O/h5ocopy_f +! NAME +! h5ocopy_f +! +! PURPOSE +! Copies an object in an HDF5 file. +! +! INPUTS +! src_loc_id - Object identifier indicating the location of the source object to be copied +! src_name - Name of the source object to be copied +! dst_loc_id - Location identifier specifying the destination +! dst_name - Name to be assigned to the new copy +! +! OPTIONAL PARAMETERS +! ocpypl_id - Object copy property list +! lcpl_id - Link creation property list for the new hard link +! +! OUTPUTS: +! hdferr - Returns 0 if successful and -1 if fails +! +! AUTHOR +! M. Scot Breitenfeld +! March 14, 2012 +! +! SOURCE + SUBROUTINE h5ocopy_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr, ocpypl_id, lcpl_id) + IMPLICIT NONE + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id +!***** + + INTEGER(SIZE_T) :: src_name_len, dst_name_len + INTEGER(HID_T) :: ocpypl_id_default, lcpl_id_default + + INTERFACE + INTEGER FUNCTION h5ocopy_c(src_loc_id, src_name, src_name_len, & + dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5OCOPY_C'::h5ocopy_c + !DEC$ENDIF + !DEC$ATTRIBUTES reference :: src_name, dst_name + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER(HID_T) , INTENT(IN) :: ocpypl_id_default + INTEGER(HID_T) , INTENT(IN) :: lcpl_id_default + INTEGER(SIZE_T) :: src_name_len, dst_name_len + + END FUNCTION h5ocopy_c + END INTERFACE + + src_name_len = LEN(src_name) + dst_name_len = LEN(dst_name) + + ocpypl_id_default = H5P_DEFAULT_F + IF(PRESENT(ocpypl_id)) ocpypl_id_default = ocpypl_id + lcpl_id_default = H5P_DEFAULT_F + IF(PRESENT(lcpl_id)) lcpl_id_default = lcpl_id + + hdferr = h5ocopy_c(src_loc_id, src_name, src_name_len, & + dst_loc_id, dst_name, dst_name_len, ocpypl_id_default, lcpl_id_default) + + END SUBROUTINE h5ocopy_f + END MODULE H5O diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index 89957a4..a504653 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -805,10 +805,12 @@ H5_FCDLL int_f nh5tconvert_c(hid_t_f *src_id, hid_t_f *dst_id, size_t_f *nelmts, #define nh5olink_c H5_FC_FUNC_(h5olink_c, H5OLINK_C) #define nh5oopen_c H5_FC_FUNC_(h5oopen_c, H5OOPEN_C) -#define nh5oclose_c H5_FC_FUNC_(h5oclose_c, H5OCLOSE_C) +#define nh5oclose_c H5_FC_FUNC_(h5oclose_c, H5OCLOSE_C) #define nh5ovisit_c H5_FC_FUNC_(h5ovisit_c,H5OVISIT_C) #define nh5oget_info_by_name_c H5_FC_FUNC_(h5oget_info_by_name_c ,H5OGET_INFO_BY_NAME_C) #define nh5oopen_by_addr_c H5_FC_FUNC_(h5oopen_by_addr_c, H5OOPEN_BY_ADDR_C) +#define nh5ocopy_c H5_FC_FUNC_(h5ocopy_c, H5OCOPY_C) + H5_FCDLL int_f nh5oopen_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen, hid_t_f *lapl_id, hid_t_f *obj_id); H5_FCDLL int_f nh5oclose_c (hid_t_f *object_id ); @@ -818,6 +820,9 @@ H5_FCDLL int_f nh5olink_c (hid_t_f *object_id, hid_t_f *new_loc_id, _fcd name, s H5_FCDLL int_f nh5ovisit_c (hid_t_f *group_id, int_f *index_type, int_f *order, H5O_iterate_t op, void *op_data); H5_FCDLL int_f nh5oget_info_by_name_c (hid_t_f *loc_id, _fcd name, size_t_f *namelen,hid_t_f *lapl_id, H5O_info_t_f *object_info); +H5_FCDLL int_f nh5ocopy_c (hid_t_f *src_loc_id, _fcd src_name, size_t_f *src_name_len, + hid_t_f *dst_loc_id, _fcd dst_name, size_t_f *dst_name_len, + hid_t_f *ocpypl_id, hid_t_f *lcpl_id ); /* * Functions from H5Pf.c */ diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index d871e59..f49906b 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -87,6 +87,11 @@ SUBROUTINE test_h5o_link(total_error) INTEGER :: i, n, j INTEGER :: error ! /* Value returned from API calls */ + CHARACTER(LEN=14) :: NAME_DATATYPE_SIMPLE="H5T_NATIVE_INT" + CHARACTER(LEN=16) :: NAME_DATATYPE_SIMPLE2="H5T_NATIVE_INT-2" + INTEGER(HID_T) :: tid, tid2 + LOGICAL :: flag + ! /* Initialize the raw data */ DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 @@ -222,8 +227,6 @@ SUBROUTINE test_h5o_link(total_error) CALL h5tclose_f(type_id, error) CALL check("h5tclose_f",error,total_error) - CALL h5fclose_f(file_id, error) - CALL check("h5fclose_f",error,total_error) ! /* Close remaining IDs */ CALL h5sclose_f(space_id, error) @@ -231,6 +234,52 @@ SUBROUTINE test_h5o_link(total_error) CALL h5pclose_f(lcpl_id,error) CALL check("h5pclose_f", error, total_error) + + ! ********************* + ! CHECK H5OCOPY_F + ! ********************* + + ! create datatype + CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) + CALL check("h5tcopy_f", error, total_error) + + ! create named datatype + CALL h5tcommit_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) + CALL check("h5tcommit_f", error, total_error) + + ! close the datatype + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f",error) + + CALL h5ocopy_f(file_id, NAME_DATATYPE_SIMPLE, file_id, NAME_DATATYPE_SIMPLE2, error) + CALL check("h5ocopy_f",error,total_error) + + ! open the datatype for copy + CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) + CALL check("h5topen_f",error,total_error) + + ! open the copied datatype + CALL h5topen_f(file_id, NAME_DATATYPE_SIMPLE2, tid2, error) + CALL check("h5topen_f",error,total_error) + + ! Compare the datatypes + CALL h5tequal_f(tid, tid2, flag, error) + IF(.NOT.flag)THEN + WRITE(*,*) "h5ocopy_f FAILED" + total_error = total_error + 1 + ENDIF + + ! close the destination datatype + CALL h5tclose_f(tid, error) + CALL check("h5tclose_f",error,total_error) + + ! close the destination datatype + CALL h5tclose_f(tid2, error) + CALL check("h5tclose_f",error,total_error) + + CALL h5fclose_f(file_id, error) + CALL check("h5fclose_f",error,total_error) + END SUBROUTINE test_h5o_link !/**************************************************************** -- cgit v0.12 From 14d6c0ee9ac12bb5d691f143b48c066fa365f2af Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Sun, 25 Mar 2012 23:30:48 -0500 Subject: [svn-r22143] Description: added info about h5ocopy_f and h5ltget_attribute_string_f --- release_docs/RELEASE.txt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d4ff01d..415a548 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -172,6 +172,11 @@ New Features Fortran Library: ---------------- + + - Added for the C API the Fortran wrapper: + h5ocopy_f (MSB - 2012/03/22) + + HDF5 Fortran library was enhanced to support Fortran 2003 standard. The following features are available when the HDF5 library is configured using --enable-fortran --enable-fortran2003 configure flags AND @@ -352,7 +357,7 @@ New Features - New API: h5ltpath_valid (Fortran: h5ltpath_valid_f) which checks if a path is correct and determines if a link resolves to a valid - object and does not dangle. (MSB- 2012/3/15) + object and checks that the link does not dangle. (MSB- 2012/3/15) Documentation ------------- @@ -882,6 +887,10 @@ Bug Fixes since HDF5-1.8.0 release Fortran High-Level APIs: ------ + + - Lite: The h5ltget_attribute_string_f used to return the C NULL character in the + returned character buffer. The returned Fortran charactor buffer now does + not return the C NULL character. (MSB - 2012/3/23) - Lite: The h5ltget_dataset_info_f function (gets information about a dataset) was not correctly returning the dimension array. (PVN - 2009/3/23) - Lite: the h5ltread_dataset_string_f and h5ltget_attribute_string_f functions -- cgit v0.12 From 286c8ac306e9f0c7bb62b42d61b7ad047c62bf8f Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 26 Mar 2012 08:33:59 -0500 Subject: [svn-r22144] Added DLL h5ocopy_f entry for windows. --- fortran/src/hdf5_fortrandll.def | 1 + fortran/src/phdf5_fortrandll.def | 1 + 2 files changed, 2 insertions(+) diff --git a/fortran/src/hdf5_fortrandll.def b/fortran/src/hdf5_fortrandll.def index 6b3aad8..29e83f5 100644 --- a/fortran/src/hdf5_fortrandll.def +++ b/fortran/src/hdf5_fortrandll.def @@ -284,6 +284,7 @@ H5L_mp_H5LIS_REGISTERED_F H5L_mp_H5LMOVE_F H5L_mp_H5LGET_NAME_BY_IDX_F ; H5O +H5O_mp_H5OCOPY_F H5O_mp_H5OLINK_F H5O_mp_H5OOPEN_F H5O_mp_H5OOPEN_BY_ADDR_F diff --git a/fortran/src/phdf5_fortrandll.def b/fortran/src/phdf5_fortrandll.def index a4bc9eb..7a196cd 100644 --- a/fortran/src/phdf5_fortrandll.def +++ b/fortran/src/phdf5_fortrandll.def @@ -284,6 +284,7 @@ H5L_mp_H5LIS_REGISTERED_F H5L_mp_H5LMOVE_F H5L_mp_H5LGET_NAME_BY_IDX_F ; H5O +H5O_mp_H5OCOPY_F H5O_mp_H5OLINK_F H5O_mp_H5OOPEN_F H5O_mp_H5OOPEN_BY_ADDR_F -- cgit v0.12 From 22a432b587c08daf87faf957ea5667ea99ae057d Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Mon, 26 Mar 2012 14:30:45 -0500 Subject: [svn-r22146] Purpose: HDFFV-398: h5cc doesn't work with automake Description: Fixed compiler wrapper scripts to correctly detect compilation when -MT preprocessor flag is provided, fixing a bug in which its *.o argument was added to link_objs but not compile_args. This previously broke usage of h5cc as the provided compiler in configure scripts (like with h5edit) as automake may supply the -MT option to the compiler via the makefiles. Tested: Tested using h5edit and h5committested. --- c++/src/h5c++.in | 2 +- fortran/src/h5fc.in | 2 +- tools/misc/h5cc.in | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in index 39d3d2a..20435eb 100755 --- a/c++/src/h5c++.in +++ b/c++/src/h5c++.in @@ -208,7 +208,7 @@ for arg in $@ ; do get_output_file="yes" fi ;; - -E|-M) + -E|-M|-MT) allargs="$allargs $arg" compile_args="$compile_args $arg" dash_c="yes" diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in index 9e9409d..2d7b5b4 100755 --- a/fortran/src/h5fc.in +++ b/fortran/src/h5fc.in @@ -189,7 +189,7 @@ for arg in $@ ; do get_output_file="yes" fi ;; - -E|-M) + -E|-M|-MT) allargs="$allargs $arg" compile_args="$compile_args $arg" dash_c="yes" diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in index a1421a2..233c80a 100755 --- a/tools/misc/h5cc.in +++ b/tools/misc/h5cc.in @@ -220,7 +220,7 @@ for arg in $@ ; do get_output_file="yes" fi ;; - -E|-M) + -E|-M|-MT) allargs="$allargs $arg" compile_args="$compile_args $arg" dash_c="yes" -- cgit v0.12 From 4d7d1ab871ac5b98b8560f38fba2fad9b9d2e00c Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Mon, 26 Mar 2012 14:34:42 -0500 Subject: [svn-r22147] Purpose: Update RELEASE.txt for HDFFV-398 Tested: None needed, doc only. --- release_docs/RELEASE.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 415a548..5057edd 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -602,6 +602,9 @@ Bug Fixes since HDF5-1.8.0 release Configuration ------------- + - Makefiles generated by other packages using h5cc as the compiler + no longer error when 'make' is invoked more than once in order + to 'rebuild' after changes to source. (MAM - 2012/03/26) - Added --enable-fortran2003 flag to enable Fortran2003 support in the HDF5 Fortran library. The flag should be used along with the --enable-fortran flag and takes affect only when Fortran compiler -- cgit v0.12 From 086035bedefa3b318a18a34eaf3c2a3873af0822 Mon Sep 17 00:00:00 2001 From: Mike McGreevy Date: Mon, 26 Mar 2012 15:26:06 -0500 Subject: [svn-r22149] Purpose: HDFFV-944: Fortran test problem with HDF5 182, intel 11.0, open-mpi-1.2.8 Description: Moved libtool post-processing 'ed' snippet that replaces wl="" with wl="-Wl," when intel compilers are used to the end of the configure script, after libtool is actually generated. (I imagine that at some point in time during a libtool version upgrade the libtool script ceased being generated immediately after the libtool initialization macro and is generated at the end of configure with all other files). Additionally, added a leading 'g' to the replacement invocation to change all instances of wl="" to wl="-Wl," instead of just the first that it comes across. (There's a separate one for each compiler used (C, Fortran, C++)). Tested: Reproduced the reported make failure and tested resolution on NCSA's Forge with OpenMPI built with Intel 12.0.4. Also, h5committested. --- configure | 34 +++++++++++++++++----------------- configure.in | 35 +++++++++++++++++------------------ release_docs/RELEASE.txt | 3 +++ 3 files changed, 37 insertions(+), 35 deletions(-) diff --git a/configure b/configure index ecaef5a..ec43c82 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22097 2012-03-20 13:00:55Z hdftest . +# From configure.in Id: configure.in 22140 2012-03-25 14:30:39Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.113. # @@ -21553,22 +21553,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -case $host_os in - linux* | freebsd* ) - # If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile < /dev/null -/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we should install only statically linked executables" >&5 $as_echo_n "checking if we should install only statically linked executables... " >&6; } # Check whether --enable-static_exec was given. @@ -34964,6 +34948,22 @@ touch ./config/stamp2 # Finally the makefiles test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +case $host_os in + linux* | freebsd* ) + # If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile < /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + if (./libtool --features | grep '^enable shared libraries' > /dev/null); then enable_shared=yes else diff --git a/configure.in b/configure.in index 8854177..b53d57c 100644 --- a/configure.in +++ b/configure.in @@ -1027,24 +1027,6 @@ dnl or disabled, it should happen before these macros. AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL -dnl Post processing to patch up some deficiencies in libtool (as of -dnl Libtool 1.5.14) -case $host_os in - linux* | freebsd* ) - # If gcc is not used, need to set $wl to use "-Wl," - if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then - : using gcc - else - echo 'fixing $wl in' $ofile -ed - $ofile < /dev/null -/^wl=""/s//wl="-Wl,"/ -w -q -EOF - fi - ;; -esac - dnl ---------------------------------------------------------------------- dnl Check if we should install only statically linked executables. dnl This check needs to occur after libtool is initialized because @@ -4470,6 +4452,23 @@ touch ./config/stamp2 # Finally the makefiles test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +dnl Post processing to patch up some deficiencies in libtool +case $host_os in + linux* | freebsd* ) + # If gcc is not used, need to set $wl to use "-Wl," + if $CC -v 2>&1 | grep '^gcc' > /dev/null ; then + : using gcc + else + echo 'fixing $wl in' $ofile +ed - $ofile < /dev/null +g/^wl=""/s//wl="-Wl,"/ +w +q +EOF + fi + ;; +esac + dnl Are we compiling static libraries, shared libraries, or both? This dnl is only used for the libhdf5.settings file. We can't just look at dnl $enable_static and $enable_shared because if they're yes the ltconfig diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 5057edd..6992d8c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -602,6 +602,9 @@ Bug Fixes since HDF5-1.8.0 release Configuration ------------- + - Fixed Makefile issue in which "-Wl," was not properly specified + prior to -rpath when building parallel fortran libraries with + an Intel compiler. (MAM - 2012/03/26) - Makefiles generated by other packages using h5cc as the compiler no longer error when 'make' is invoked more than once in order to 'rebuild' after changes to source. (MAM - 2012/03/26) -- cgit v0.12 From 2b3a190501b005be08ce8d4ffeb0b59f10ec5c1a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 26 Mar 2012 16:11:50 -0500 Subject: [svn-r22152] Added a "skipped" message to the istore sparse test function. Minor change: tested on jam (test not skipped) and Mac OS-X Lion (test skipped due to HFS not supporting sparse files). --- test/istore.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/test/istore.c b/test/istore.c index 0c970bc..81d7eb6 100644 --- a/test/istore.c +++ b/test/istore.c @@ -467,7 +467,7 @@ error: */ static herr_t test_sparse(hid_t f, const char *prefix, size_t nblocks, - size_t nx, size_t ny, size_t nz) + size_t nx, size_t ny, size_t nz, int skip_test) { hid_t dataset; /* Dataset ID */ hid_t fspace; /* Dataset's file dataspace */ @@ -499,6 +499,10 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks, sprintf(s, "istore sparse: %s", dims); TESTING(s); + if(skip_test){ + SKIPPED() + return SUCCEED; + } buf = (uint8_t *)HDmalloc(nx * ny * nz); HDmemset(buf, 128, nx * ny * nz); @@ -601,6 +605,7 @@ main(int argc, char *argv[]) unsigned size_of_test; unsigned u; /* Local index variable */ char filename[1024]; + int skip_test = 0; int has_sparse_support = 0; /* Parse arguments or assume these tests (`small', `medium' ) */ @@ -683,27 +688,29 @@ main(int argc, char *argv[]) status = test_extend(file, "extend", (size_t)10, (size_t)400, (size_t)10); nerrors += status < 0 ? 1 : 0; } + skip_test = 0; if (size_of_test & TEST_SMALL) { - status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0); + status = test_sparse(file, "sparse", (size_t)100, (size_t)5, (size_t)0, (size_t)0, skip_test); nerrors += status < 0 ? 1 : 0; - status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0); + status = test_sparse(file, "sparse", (size_t)100, (size_t)3, (size_t)4, (size_t)0, skip_test); nerrors += status < 0 ? 1 : 0; - status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4); + status = test_sparse(file, "sparse", (size_t)100, (size_t)2, (size_t)3, (size_t)4, skip_test); nerrors += status < 0 ? 1 : 0; } if (size_of_test & TEST_MEDIUM) { - status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0); + status = test_sparse(file, "sparse", (size_t)1000, (size_t)30, (size_t)0, (size_t)0, skip_test); nerrors += status < 0 ? 1 : 0; - status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0); + status = test_sparse(file, "sparse", (size_t)2000, (size_t)7, (size_t)3, (size_t)0, skip_test); nerrors += status < 0 ? 1 : 0; - status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3); + status = test_sparse(file, "sparse", (size_t)2000, (size_t)4, (size_t)2, (size_t)3, skip_test); nerrors += status < 0 ? 1 : 0; } - if (has_sparse_support && size_of_test & TEST_LARGE) { + skip_test = !has_sparse_support; + if (size_of_test & TEST_LARGE) { /* This test is skipped if there is no POSIX-style sparse file support * e.g.: Windows NTFS filesystems */ - status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50); + status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50, skip_test); nerrors += status < 0 ? 1 : 0; } -- cgit v0.12 From a9e2b5463d73681c4f19b2c148fbbc0d6d2dbd1e Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 26 Mar 2012 22:57:17 -0500 Subject: [svn-r22154] Fixed comments for h5pcreate_f; added missing property classes. Tested: N/A --- fortran/src/H5Pff.f90 | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index 2d874d0..d50e3b9 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -53,11 +53,23 @@ CONTAINS ! INPUTS ! class - type of the property class to be created. ! Possible values are: -! H5P_FILE_CREATE_F -! H5P_FILE_ACCESS_F -! H5P_DATASET_CREATE_F -! H5P_DATASET_XFER_F -! H5P_FILE_MOUNT_F +! H5P_OBJECT_CREATE_F +! H5P_FILE_CREATE_F +! H5P_FILE_ACCESS_F +! H5P_DATASET_CREATE_F +! H5P_DATASET_ACCESS_F +! H5P_DATASET_XFER_F +! H5P_FILE_MOUNT_F +! H5P_GROUP_CREATE_F +! H5P_GROUP_ACCESS_F +! H5P_DATATYPE_CREATE_F +! H5P_DATATYPE_ACCESS_F +! H5P_STRING_CREATE_F +! H5P_ATTRIBUTE_CREATE _F +! H5P_OBJECT_COPY_F +! H5P_LINK_CREATE_F +! H5P_LINK_ACCESS_F +! ! OUTPUTS ! prp_id - property list identifier ! hdferr - error code @@ -76,16 +88,9 @@ CONTAINS ! Fortran90 Interface: SUBROUTINE h5pcreate_f(class, prp_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: class ! The type of the property list - ! to be created. Possible values are: - ! H5P_FILE_CREATE_F - ! H5P_FILE_ACCESS_F - ! H5P_DATASET_CREATE_F - ! H5P_DATASET_XFER_F - ! H5P_FILE_MOUNT_F - INTEGER(HID_T), INTENT(OUT) :: prp_id ! Property list identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! 0 on success and -1 on failure + INTEGER(HID_T), INTENT(IN) :: class + INTEGER(HID_T), INTENT(OUT) :: prp_id + INTEGER , INTENT(OUT) :: hdferr !***** ! INTEGER, EXTERNAL :: h5pcreate_c ! MS FORTRAN needs explicit interface for C functions called here. -- cgit v0.12 From e4291accaa899389a399c1e2370b45247b4d0c3f Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 27 Mar 2012 16:49:08 -0500 Subject: [svn-r22161] Added a message when the time-consuming test is skipped due to a lack of sparse file support. Minor change: tested on 64-bit Windows 7 --- test/istore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/istore.c b/test/istore.c index 81d7eb6..f99e835 100644 --- a/test/istore.c +++ b/test/istore.c @@ -711,6 +711,8 @@ main(int argc, char *argv[]) * e.g.: Windows NTFS filesystems */ status = test_sparse(file, "sparse", (size_t)800, (size_t)50, (size_t)50, (size_t)50, skip_test); + if(skip_test) + printf(" The current VFD does not support sparse files on this platform.\n"); nerrors += status < 0 ? 1 : 0; } -- cgit v0.12 From 0ce5cbc925da284019918d36a72eb30e96d9789b Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Wed, 28 Mar 2012 00:43:22 -0500 Subject: [svn-r22163] Added tests for optional parameters in h5ocopy_f. Cleaned up comments by removing "C" notation comments Tested: jam (gnu, intel) koala (intel) --- fortran/test/tH5O.f90 | 205 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 143 insertions(+), 62 deletions(-) diff --git a/fortran/test/tH5O.f90 b/fortran/test/tH5O.f90 index f49906b..247d1d0 100644 --- a/fortran/test/tH5O.f90 +++ b/fortran/test/tH5O.f90 @@ -72,6 +72,7 @@ SUBROUTINE test_h5o_link(total_error) INTEGER(HID_T) :: type_id INTEGER(HID_T) :: fapl_id INTEGER(HID_T) :: lcpl_id + INTEGER(HID_T) :: ocpypl_id INTEGER(HID_T) :: mem_space_id, file_space_id, xfer_prp CHARACTER(LEN=11), PARAMETER :: TEST_FILENAME = 'TestFile.h5' INTEGER, PARAMETER :: TEST6_DIM1 = 2, TEST6_DIM2 = 5 @@ -82,57 +83,65 @@ SUBROUTINE test_h5o_link(total_error) INTEGER, PARAMETER :: TRUE = 1, FALSE = 0 - LOGICAL :: committed ! /* Whether the named datatype is committed */ + LOGICAL :: committed ! /* Whether the named datatype is committed INTEGER :: i, n, j - INTEGER :: error ! /* Value returned from API calls */ + INTEGER :: error ! /* Value returned from API calls CHARACTER(LEN=14) :: NAME_DATATYPE_SIMPLE="H5T_NATIVE_INT" CHARACTER(LEN=16) :: NAME_DATATYPE_SIMPLE2="H5T_NATIVE_INT-2" INTEGER(HID_T) :: tid, tid2 LOGICAL :: flag + + ! Data for tested h5ocopy_f + CHARACTER(LEN=3) , PARAMETER :: dataset = "DS1" + INTEGER , PARAMETER :: dim0 = 4 + + INTEGER(HSIZE_T), DIMENSION(1:1) :: dims2 = (/dim0/) ! size read/write buffer + INTEGER , DIMENSION(1:dim0) :: wdata2, & ! Write buffer + rdata2 ! Read buffer - ! /* Initialize the raw data */ + ! Initialize the raw data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 wdata(i,j) = i*j ENDDO ENDDO - ! /* Create the dataspace */ + ! Create the dataspace CALL h5screate_simple_f(2, dims, space_id, error) CALL check("h5screate_simple_f",error,total_error) - ! /* Create LCPL with intermediate group creation flag set */ + ! Create LCPL with intermediate group creation flag set CALL H5Pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) CALL check("h5Pcreate_f",error,total_error) CALL H5Pset_create_inter_group_f(lcpl_id, TRUE, error) CALL check("H5Pset_create_inter_group_f",error,total_error) - ! /* Loop over using new group format */ + ! Loop over using new group format ! for(new_format = FALSE; new_format <= TRUE; new_format++) { - !/* Make a FAPL that uses the "use the latest version of the format" bounds */ + ! Make a FAPL that uses the "use the latest version of the format" bounds CALL H5Pcreate_f(H5P_FILE_ACCESS_F,fapl_id,error) CALL check("h5Pcreate_f",error,total_error) - ! /* Set the "use the latest version of the format" bounds for creating objects in the file */ + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl_id, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pset_libver_bounds_f",error, total_error) !!$ ret = H5Pset_libver_bounds(fapl_id, (new_format ? H5F_LIBVER_LATEST : H5F_LIBVER_EARLIEST), H5F_LIBVER_LATEST); - ! /* Create a new HDF5 file */ + ! Create a new HDF5 file CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, file_id, error, H5P_DEFAULT_F, fapl_id) CALL check("H5Fcreate_f", error, total_error) - ! /* Close the FAPL */ + ! Close the FAPL CALL h5pclose_f(fapl_id, error) CALL check("h5pclose_f",error,total_error) - ! /* Create and commit a datatype with no name */ + ! Create and commit a datatype with no name CALL H5Tcopy_f( H5T_NATIVE_INTEGER, type_id, error) CALL check("H5Tcopy_F",error,total_error) @@ -143,27 +152,27 @@ SUBROUTINE test_h5o_link(total_error) CALL check("H5Tcommitted_f",error,total_error) CALL verifyLogical("H5Tcommitted_f", committed, .TRUE., total_error) - ! /* Create a dataset with no name using the committed datatype*/ + ! Create a dataset with no name using the committed datatype CALL H5Dcreate_anon_f(file_id, type_id, space_id, dset_id, error ) ! using no optional parameters CALL check("H5Dcreate_anon_f",error,total_error) - ! /* Verify that we can write to and read from the dataset */ + ! Verify that we can write to and read from the dataset - ! /* Write the data to the dataset */ + ! Write the data to the dataset !EP CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error, & !EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata, dims, error) CALL check("h5dwrite_f", error, total_error) - ! /* Read the data back */ + ! Read the data back !EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & !EP mem_space_id=H5S_ALL_F, file_space_id=H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) CALL check("h5dread_f", error, total_error) - ! /* Verify the data */ + ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 CALL VERIFY("H5Dread_f",wdata(i,j),rdata(i,j),total_error) @@ -171,31 +180,31 @@ SUBROUTINE test_h5o_link(total_error) ENDDO ENDDO - ! /* Create a group with no name*/ + ! Create a group with no name CALL H5Gcreate_anon_f(file_id, group_id, error) CALL check("H5Gcreate_anon", error, total_error) - ! /* Link nameless datatype into nameless group */ + ! Link nameless datatype into nameless group CALL H5Olink_f(type_id, group_id, "datatype", error, H5P_DEFAULT_F) CALL check("H5Olink_f", error, total_error) - ! /* Link nameless dataset into nameless group with intermediate group */ + ! Link nameless dataset into nameless group with intermediate group CALL H5Olink_f(dset_id, group_id, "inter_group/dataset", error, lcpl_id, H5P_DEFAULT_F) CALL check("H5Olink_f", error, total_error) - ! /* Close IDs for dataset and datatype */ + ! Close IDs for dataset and datatype CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f", error, total_error) CALL h5tclose_f(type_id, error) CALL check("h5tclose_f", error, total_error) - ! /* Re-open datatype using new link */ + ! Re-open datatype using new link CALL H5Topen_f(group_id, "datatype", type_id, error) CALL check("h5topen_f", error, total_error) - ! /* Link nameless group to root group and close the group ID*/ + ! Link nameless group to root group and close the group ID CALL H5Olink_f(group_id, file_id, "/group", error) CALL check("H5Olink_f", error, total_error) @@ -203,24 +212,24 @@ SUBROUTINE test_h5o_link(total_error) CALL h5gclose_f(group_id, error) CALL check("h5gclose_f",error,total_error) - ! /* Open dataset through root group and verify its data */ + ! Open dataset through root group and verify its data CALL H5Dopen_f(file_id, "/group/inter_group/dataset", dset_id, error) CALL check("test_lcpl.h5dopen_f", error, total_error) - ! /* Read data from dataset */ + ! Read data from dataset !EP CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error, & !EP H5S_ALL_F, H5S_ALL_F, xfer_prp = H5P_DEFAULT_F) CALL h5dread_f(dset_id, H5T_NATIVE_INTEGER, rdata, dims, error) CALL check("h5dread_f", error, total_error) - ! /* Verify the data */ + ! Verify the data DO i = 1, TEST6_DIM1 DO j = 1, TEST6_DIM2 CALL VERIFY("H5Dread",wdata(i,j),rdata(i,j),total_error) ENDDO ENDDO - ! /* Close open IDs */ + ! Close open IDs CALL h5dclose_f(dset_id, error) CALL check("h5dclose_f",error,total_error) @@ -228,22 +237,94 @@ SUBROUTINE test_h5o_link(total_error) CALL check("h5tclose_f",error,total_error) - ! /* Close remaining IDs */ + ! Close remaining IDs CALL h5sclose_f(space_id, error) CALL check("h5sclose_f",error,total_error) CALL h5pclose_f(lcpl_id,error) CALL check("h5pclose_f", error, total_error) - ! ********************* ! CHECK H5OCOPY_F ! ********************* + DO i = 1, dim0 + wdata2(i) = i-1 + ENDDO + ! + ! Create dataspace. Setting size to be the current size. + ! + CALL h5screate_simple_f(1, dims2, space_id, error) + CALL check("h5screate_simple_f", error, total_error) + ! + ! Create intermediate groups + ! + CALL h5gcreate_f(file_id,"/G1",group_id,error) + CALL check("h5gcreate_f", error, total_error) + CALL h5gcreate_f(file_id,"/G1/G2",group_id,error) + CALL check("h5gcreate_f", error, total_error) + CALL h5gcreate_f(file_id,"/G1/G2/G3",group_id,error) + CALL check("h5gcreate_f", error, total_error) + ! + ! Create the dataset + ! + CALL h5dcreate_f(group_id, dataset, H5T_STD_I32LE, space_id, dset_id, error) + CALL check("h5dcreate_f", error, total_error) + ! + ! Write the data to the dataset. + ! + CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, wdata2, dims2, error) + CALL check("h5dwrite_f", error, total_error) + ! + ! Close and release resources. + ! + CALL h5dclose_f(dset_id , error) + CALL check(" h5dclose_f", error, total_error) + CALL h5sclose_f(space_id, error) + CALL check("h5sclose_f", error, total_error) + CALL h5gclose_f(group_id, error) + CALL check("h5gclose_f", error, total_error) + ! + ! create property to pass copy options + ! + CALL h5pcreate_f(H5P_LINK_CREATE_F, lcpl_id, error) + CALL check("h5Pcreate_f", error, total_error) + + CALL h5pset_create_inter_group_f(lcpl_id, TRUE, error) + CALL check("H5Pset_create_inter_group_f", error, total_error) + ! + ! Check optional parameter lcpl_id, this would fail if lcpl_id was not specified + ! + CALL h5ocopy_f(file_id, "/G1/G2/G3/DS1", file_id, "/G1/G_cp1/DS2", error, lcpl_id=lcpl_id) + CALL check("h5ocopy_f -- W/ OPTION: lcpl_id", error ,total_error) + + CALL h5pclose_f(lcpl_id, error) + CALL check("h5pclose_f",error,total_error) + + CALL h5pcreate_f(H5P_OBJECT_COPY_F, ocpypl_id, error) + CALL check("h5Pcreate_f",error,total_error) + + CALL h5pset_copy_object_f(ocpypl_id, H5O_COPY_SHALLOW_HIERARCHY_F, error) + CALL check("H5Pset_copy_object_f",error,total_error) + + CALL h5ocopy_f(file_id, "/G1/G2", file_id, "/G1/G_cp2", error, ocpypl_id=ocpypl_id) + CALL check("h5ocopy_f",error,total_error) + + ! Makes sure the "DS1" dataset was not copied since we set a + ! flag to copy only immediate members of a group. + ! Therefore, this should fail. + CALL h5dopen_f(file_id, "/G1/G_cp2/DS1", dset_id, error) + IF(error.EQ.0)THEN + CALL check("h5ocopy_f -- W/ OPTION: ocpypl_id", -1, total_error) + ENDIF + + CALL h5pclose_f(ocpypl_id, error) + CALL check("h5pclose_f",error,total_error) + ! create datatype CALL h5tcopy_f(H5T_NATIVE_INTEGER, tid, error) CALL check("h5tcopy_f", error, total_error) - ! create named datatype + ! create named datatype CALL h5tcommit_f(file_id, NAME_DATATYPE_SIMPLE, tid, error) CALL check("h5tcommit_f", error, total_error) @@ -282,11 +363,11 @@ SUBROUTINE test_h5o_link(total_error) END SUBROUTINE test_h5o_link -!/**************************************************************** +!*************************************************************** !** !** test_h5o_plist(): Test object creation properties !** -!****************************************************************/ +!*************************************************************** SUBROUTINE test_h5o_plist(total_error) @@ -295,31 +376,31 @@ SUBROUTINE test_h5o_plist(total_error) IMPLICIT NONE INTEGER, INTENT(OUT) :: total_error - INTEGER(hid_t) :: fid !/* HDF5 File ID */ - INTEGER(hid_t) :: grp, dset, dtype, dspace !/* Object identifiers */ - INTEGER(hid_t) :: fapl !/* File access property list */ - INTEGER(hid_t) :: gcpl, dcpl, tcpl !/* Object creation properties */ - INTEGER :: def_max_compact, def_min_dense !/* Default phase change parameters */ - INTEGER :: max_compact, min_dense !/* Actual phase change parameters */ - INTEGER :: error !/* Value returned from API calls */ + INTEGER(hid_t) :: fid ! HDF5 File ID + INTEGER(hid_t) :: grp, dset, dtype, dspace ! Object identifiers + INTEGER(hid_t) :: fapl ! File access property list + INTEGER(hid_t) :: gcpl, dcpl, tcpl ! Object creation properties + INTEGER :: def_max_compact, def_min_dense ! Default phase change parameters + INTEGER :: max_compact, min_dense ! Actual phase change parameters + INTEGER :: error ! Value returned from API calls CHARACTER(LEN=7), PARAMETER :: TEST_FILENAME = 'test.h5' ! PRINT*,'Testing object creation properties' - !/* Make a FAPL that uses the "use the latest version of the format" flag */ + ! Make a FAPL that uses the "use the latest version of the format" flag CALL H5Pcreate_f(H5P_FILE_ACCESS_F, fapl, error) CALL check("H5Pcreate_f", error, total_error) - ! /* Set the "use the latest version of the format" bounds for creating objects in the file */ + ! Set the "use the latest version of the format" bounds for creating objects in the file CALL H5Pset_libver_bounds_f(fapl, H5F_LIBVER_LATEST_F, H5F_LIBVER_LATEST_F, error) CALL check("H5Pcreate_f", error, total_error) - ! /* Create a new HDF5 file */ + ! Create a new HDF5 file CALL H5Fcreate_f(TEST_FILENAME, H5F_ACC_TRUNC_F, fid, error, access_prp=fapl) CALL check("H5Fcreate_f", error, total_error) - ! /* Create group, dataset & named datatype creation property lists */ + ! Create group, dataset & named datatype creation property lists CALL H5Pcreate_f(H5P_GROUP_CREATE_F, gcpl, error) CALL check("H5Pcreate_f", error, total_error) CALL H5Pcreate_f(H5P_DATASET_CREATE_F, dcpl, error) @@ -327,11 +408,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Pcreate_f(H5P_DATATYPE_CREATE_F, tcpl, error) CALL check("H5Pcreate_f", error, total_error) - ! /* Retrieve default attribute phase change values */ + ! Retrieve default attribute phase change values CALL H5Pget_attr_phase_change_f(gcpl, def_max_compact, def_min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - ! /* Set non-default attribute phase change values on each creation property list */ + ! Set non-default attribute phase change values on each creation property list CALL H5Pset_attr_phase_change_f(gcpl, def_max_compact+1, def_min_dense-1, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL H5Pset_attr_phase_change_f(dcpl, def_max_compact+1, def_min_dense-1, error) @@ -339,7 +420,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Pset_attr_phase_change_f(tcpl, def_max_compact+1, def_min_dense-1, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) - ! /* Retrieve attribute phase change values on each creation property list and verify */ + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -356,18 +437,18 @@ SUBROUTINE test_h5o_plist(total_error) CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - !/* Create a group, dataset, and committed datatype within the file, - ! * using the respective type of creation property lists. - ! */ + ! Create a group, dataset, and committed datatype within the file, + ! using the respective type of creation property lists. + ! - !/* Create the group anonymously and link it in */ + ! Create the group anonymously and link it in CALL H5Gcreate_anon_f(fid, grp, error, gcpl_id=gcpl) CALL check("H5Gcreate_anon_f", error, total_error) CALL H5Olink_f(grp, fid, "group", error) CALL check("H5Olink_f", error, total_error) - ! /* Commit the type inside the group anonymously and link it in */ + ! Commit the type inside the group anonymously and link it in CALL h5tcopy_f(H5T_NATIVE_INTEGER, dtype, error) CALL check("h5tcopy_f", error, total_error) @@ -377,11 +458,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Olink_f(dtype, fid, "datatype", error) CALL check("H5Olink_f", error, total_error) - ! /* Create the dataspace for the dataset. */ + ! Create the dataspace for the dataset. CALL h5screate_f(H5S_SCALAR_F, dspace, error) CALL check("h5screate_f",error,total_error) - ! /* Create the dataset anonymously and link it in */ + ! Create the dataset anonymously and link it in CALL H5Dcreate_anon_f(fid, H5T_NATIVE_INTEGER, dspace, dset, error, dcpl ) CALL check("H5Dcreate_anon_f",error,total_error) @@ -392,7 +473,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL check("h5sclose_f",error,total_error) - ! /* Close current creation property lists */ + ! Close current creation property lists CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) CALL h5pclose_f(dcpl,error) @@ -400,7 +481,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL h5pclose_f(tcpl,error) CALL check("h5pclose_f", error, total_error) - ! /* Retrieve each object's creation property list */ + ! Retrieve each object's creation property list CALL H5Gget_create_plist_f(grp, gcpl, error) CALL check("H5Gget_create_plist", error, total_error) @@ -412,7 +493,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL check("H5Dget_create_plist_f", error, total_error) - ! /* Retrieve attribute phase change values on each creation property list and verify */ + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -429,7 +510,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - !/* Close current objects */ + ! Close current objects CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) @@ -447,11 +528,11 @@ SUBROUTINE test_h5o_plist(total_error) CALL check("h5dclose_f",error,total_error) CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! /* Re-open the file and check that the object creation properties persist */ + ! Re-open the file and check that the object creation properties persist CALL h5fopen_f(TEST_FILENAME, H5F_ACC_RDONLY_F, fid, error, access_prp=fapl) CALL check("H5fopen_f",error,total_error) - ! /* Re-open objects */ + ! Re-open objects CALL H5Gopen_f(fid, "group", grp, error) CALL check("h5gopen_f", error, total_error) @@ -461,7 +542,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL H5Dopen_f(fid, "dataset", dset, error) CALL check("h5dopen_f", error, total_error) - ! /* Retrieve each object's creation property list */ + ! Retrieve each object's creation property list CALL H5Gget_create_plist_f(grp, gcpl, error) CALL check("H5Gget_create_plist", error, total_error) @@ -472,7 +553,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL check("H5Dget_create_plist_f", error, total_error) - ! /* Retrieve attribute phase change values on each creation property list and verify */ + ! Retrieve attribute phase change values on each creation property list and verify CALL H5Pget_attr_phase_change_f(gcpl, max_compact, min_dense, error) CALL check("H5Pget_attr_phase_change_f", error, total_error) CALL VERIFY("H5Pget_attr_phase_change_f", max_compact, (def_max_compact + 1), total_error) @@ -489,7 +570,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL VERIFY("H5Pget_attr_phase_change_f", min_dense, (def_min_dense - 1), total_error) - ! /* Close current objects */ + ! Close current objects CALL h5pclose_f(gcpl,error) CALL check("h5pclose_f", error, total_error) @@ -508,7 +589,7 @@ SUBROUTINE test_h5o_plist(total_error) CALL h5fclose_f(fid, error) CALL check("h5fclose_f",error,total_error) - ! /* Close the FAPL */ + ! Close the FAPL CALL H5Pclose_f(fapl, error) CALL check("H5Pclose_f", error, total_error) -- cgit v0.12 From b643da672a7d0f0a52ecfef2c229e73876e0e13d Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 28 Mar 2012 01:21:14 -0500 Subject: [svn-r22164] Fixed a bug in H5Ocopy(): When copying an opened object, call the object's flush class action to ensure that cached data is flushed so that H5Ocopy will get the correct data. (HDFFV-7853) --- release_docs/RELEASE.txt | 4 + src/H5Dint.c | 1 - src/H5Doh.c | 50 +++++++- src/H5Dpkg.h | 1 + src/H5Goh.c | 3 +- src/H5O.c | 6 +- src/H5Ocopy.c | 35 +++++- src/H5Opkg.h | 3 +- src/H5Toh.c | 3 +- test/objcopy.c | 314 +++++++++++++++++++++++++++++++++++++++++++++++ 10 files changed, 408 insertions(+), 12 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6992d8c..6c61597 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -373,6 +373,10 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed a bug in H5Ocopy(): When copying an opened object, call the + object's flush class action to ensure that cached data is flushed + so that H5Ocopy will get the correct data. + (VC - 2012/3/27 - HDFFV-7853) - When an application tries to write or read many small data chunks and runs out of memory, the library had a seg fault. The fix is to return the error stack with proper information. (SLU - 2012/3/23. diff --git a/src/H5Dint.c b/src/H5Dint.c index 9a80bfc..5c905bb 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -68,7 +68,6 @@ static herr_t H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space) static herr_t H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); static herr_t H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); -static herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id); /*********************/ diff --git a/src/H5Doh.c b/src/H5Doh.c index 7a657ec..e6a715f 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -56,6 +56,8 @@ static H5O_loc_t *H5O_dset_get_oloc(hid_t obj_id); static herr_t H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); +static herr_t H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id); + /*********************/ /* Package Variables */ @@ -81,7 +83,8 @@ const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{ H5O_dset_open, /* open an object of this class */ H5O_dset_create, /* create an object of this class */ H5O_dset_get_oloc, /* get an object header location for an object */ - H5O_dset_bh_info /* get the index & heap info for an object */ + H5O_dset_bh_info, /* get the index & heap info for an object */ + H5O_dset_flush /* flush an opened object of this class */ }}; /* Declare a free list to manage the H5D_copy_file_ud_t struct */ @@ -431,3 +434,48 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_dset_bh_info() */ + +/*------------------------------------------------------------------------- + * Function: H5O_dset_flush + * + * Purpose: To flush any dataset information cached in memory + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Vailin Choi + * February 2012 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) +{ + H5D_t *dset; /* Dataset opened */ + H5O_type_t obj_type; /* Type of object at location */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(obj_loc); + HDassert(obj_loc->oloc); + + /* Check that the object found is the correct type */ + if(H5O_obj_type(obj_loc->oloc, &obj_type, dxpl_id) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get object type") + + if(obj_type != H5O_TYPE_DATASET) + HGOTO_ERROR(H5E_DATASET, H5E_BADTYPE, FAIL, "not a dataset") + + /* Open the dataset */ + if(NULL == (dset = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) + HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") + + if(H5D_flush_real(dset, dxpl_id) < 0) + HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") + +done: + if(dset && H5D_close(dset) < 0) + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataset") + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_dset_flush() */ diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 16de07f..40317f3 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -548,6 +548,7 @@ H5_DLL herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); H5_DLL herr_t H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); H5_DLL herr_t H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); +H5_DLL herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id); /* Functions that perform direct serial I/O operations */ H5_DLL herr_t H5D_select_read(const H5D_io_info_t *io_info, diff --git a/src/H5Goh.c b/src/H5Goh.c index 194e3ec..c6115db 100644 --- a/src/H5Goh.c +++ b/src/H5Goh.c @@ -81,7 +81,8 @@ const H5O_obj_class_t H5O_OBJ_GROUP[1] = {{ H5O_group_open, /* open an object of this class */ H5O_group_create, /* create an object of this class */ H5O_group_get_oloc, /* get an object header location for an object */ - H5O_group_bh_info /* get the index & heap info for an object */ + H5O_group_bh_info, /* get the index & heap info for an object */ + NULL /* flush an opened object of this class */ }}; /* Declare the external free list to manage the H5O_ginfo_t struct */ diff --git a/src/H5O.c b/src/H5O.c index 50d9c23..104a9ae 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -79,12 +79,12 @@ typedef struct { /********************/ static herr_t H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh); -static const H5O_obj_class_t *H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id); static herr_t H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type); static herr_t H5O_visit(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id, hid_t dxpl_id); static herr_t H5O_get_hdr_info_real(const H5O_t *oh, H5O_hdr_info_t *hdr); +static const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); /*********************/ @@ -2364,7 +2364,7 @@ H5O_obj_type_real(H5O_t *oh, H5O_type_t *obj_type) * *------------------------------------------------------------------------- */ -static const H5O_obj_class_t * +const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id) { H5O_t *oh = NULL; /* Object header for location */ @@ -2401,7 +2401,7 @@ done: * *------------------------------------------------------------------------- */ -const H5O_obj_class_t * +static const H5O_obj_class_t * H5O_obj_class_real(H5O_t *oh) { size_t i; /* Local index variable */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index dd649ff..e2d792a 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -38,6 +38,7 @@ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ #include "H5HGprivate.h" /* Global Heaps */ +#include "H5FOprivate.h" /* File objects */ #include "H5Lprivate.h" /* Links */ #include "H5MFprivate.h" /* File memory management */ #include "H5MMprivate.h" /* Memory management */ @@ -281,6 +282,13 @@ done: * Programmer: Peter Cao * May 30, 2005 * + * Modifications: + * Vailin Choi; Feb 2012 + * Bug fix for HDFFV-7853 + * When the object is opened, call the object's flush class action + * to ensure that cached data is flushed so that H5Ocopy will get + * the correct data. + * *------------------------------------------------------------------------- */ static herr_t @@ -316,14 +324,33 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, HDassert(oloc_dst->file); HDassert(cpy_info); + /* Get pointer to object class for this object */ + if((obj_class = H5O_obj_class(oloc_src, dxpl_id)) == NULL) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") + + /* Check if the object at the address is already open in the file */ + if(H5FO_opened(oloc_src->file, oloc_src->addr) != NULL) { + + H5G_loc_t tmp_loc; /* Location of object */ + H5O_loc_t tmp_oloc; /* Location of object */ + H5G_name_t tmp_path; /* Object's path */ + + tmp_loc.oloc = &tmp_oloc; + tmp_loc.path = &tmp_path; + tmp_oloc.file = oloc_src->file; + tmp_oloc.addr = oloc_src->addr; + tmp_oloc.holding_file = oloc_src->holding_file; + H5G_name_reset(tmp_loc.path); + + /* Flush the object of this class */ + if(obj_class->flush && obj_class->flush(&tmp_loc, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object") + } + /* Get source object header */ if(NULL == (oh_src = H5O_protect(oloc_src, dxpl_id, H5AC_READ))) HGOTO_ERROR(H5E_OHDR, H5E_CANTPROTECT, FAIL, "unable to load object header") - /* Get pointer to object class for this object */ - if(NULL == (obj_class = H5O_obj_class_real(oh_src))) - HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to determine object type") - /* Retrieve user data for particular type of object to copy */ if(obj_class->get_copy_file_udata && (NULL == (cpy_udata = (obj_class->get_copy_file_udata)()))) diff --git a/src/H5Opkg.h b/src/H5Opkg.h index a5d01bd..d4df79b 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -325,6 +325,7 @@ typedef struct H5O_obj_class_t { void *(*create)(H5F_t *, void *, H5G_loc_t *, hid_t ); /*create an object of this class */ H5O_loc_t *(*get_oloc)(hid_t ); /*get the object header location for an object */ herr_t (*bh_info)(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); /*get the index & heap info for an object */ + herr_t (*flush)(H5G_loc_t *loc, hid_t dxpl_id); /*flush an opened object of this class */ } H5O_obj_class_t; /* Node in skip list to map addresses from one file to another during object header copy */ @@ -527,7 +528,7 @@ H5_DLL herr_t H5O_msg_flush(H5F_t *f, H5O_t *oh, H5O_mesg_t *mesg); H5_DLL herr_t H5O_flush_msgs(H5F_t *f, H5O_t *oh); H5_DLL hid_t H5O_open_by_loc(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); H5_DLL herr_t H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, H5O_mesg_t *mesg); -H5_DLL const H5O_obj_class_t *H5O_obj_class_real(H5O_t *oh); +H5_DLL const H5O_obj_class_t * H5O_obj_class(const H5O_loc_t *loc, hid_t dxpl_id); H5_DLL int H5O_link_oh(H5F_t *f, int adjust, hid_t dxpl_id, H5O_t *oh, hbool_t *deleted); H5_DLL herr_t H5O_inc_rc(H5O_t *oh); H5_DLL herr_t H5O_dec_rc(H5O_t *oh); diff --git a/src/H5Toh.c b/src/H5Toh.c index 5878075..be853f1 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -77,7 +77,8 @@ const H5O_obj_class_t H5O_OBJ_DATATYPE[1] = {{ H5O_dtype_open, /* open an object of this class */ H5O_dtype_create, /* create an object of this class */ H5O_dtype_get_oloc, /* get an object header location for an object */ - NULL /* get the index & heap info for an object */ + NULL, /* get the index & heap info for an object */ + NULL /* flush an opened object of this class */ }}; diff --git a/test/objcopy.c b/test/objcopy.c index 5c20ee8..9188713 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -8388,6 +8388,319 @@ error: /*------------------------------------------------------------------------- + * Function: test_copy_dataset_open + * + * Purpose: To ensure that H5Ocopy() copies data of opened dataset correctly. + * This is for bug fix HDFFV-7853. + * + * Test Case 1: + * Create a dataset with attributes in SRC file + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to DST file + * Close the dataset + * + * Test Case 2: + * Reopen the dataset, write new data to the dataset + * Copy the opened dataset to another location in the same file + * Copy the opened dataset to to DST file + * Close the dataset + * + * Test Case 3: + * Create a committed datatype + * Create a dataset with the committed datatype in SRC file + * Open the committed datatype + * Copy the opened dataset (with the opened committed datatype) to another location in the same file + * Copy the opened dataset (with the opened committed datatype) to DST file + * Close the dataset and the committed datatype + * + * Test Case 4: + * Create a group with attributes, create a dataset in the group + * Copy the opened group (together with the opened dataset) to another location in the same file + * Copy the opened group (together with the opened dataset) to DST file + * Close the group and the dataset + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Vailin Choi + * Feb 7, 2012 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static int +test_copy_dataset_open(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t sid = -1; /* Dataspace ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t did = -1, did2 = -1; /* Dataset IDs */ + hid_t gid = -1, gid2 = -1; /* Group IDs */ + int buf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + int newbuf[DIM_SIZE_1][DIM_SIZE_2]; /* Buffer for writing data */ + hsize_t dim2d[2]; /* Dataset dimensions */ + int i, j; /* local index variables */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + TESTING("H5Ocopy(): copying objects while opened"); + + /* Initialize write buffer */ + for (i=0; i Date: Wed, 28 Mar 2012 11:13:11 -0500 Subject: [svn-r22166] Reduce warnings from unneeded windows incude file. Reviewed HDF5-68 Tested: windows --- config/cmake/CTestCustom.cmake | 3 ++- src/H5private.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 43ef451..e708a00 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -5,9 +5,10 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" + "H5detect.c[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" + "include/string.h[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" "note:[ \t]*expected .void .. but argument is of type .volatile" "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" - "testhdf5.h.[0-9]+.[ \t]*:[ \t]*warning C4005" "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" "SZIP.src.*:[ \t]*warning" "POSIX name for this item is deprecated" diff --git a/src/H5private.h b/src/H5private.h index e01edd2..37480cb 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -151,7 +151,9 @@ #ifdef H5_HAVE_WIN32_API +/* The following two defines must be before any windows headers are included */ #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ +#define NOGDI /* Exclude Graphic Display Interface macros */ #ifdef H5_HAVE_WINSOCK_H #include -- cgit v0.12 From 6c4187b4c9b581a6d12690a180d25efec8b6aba3 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 28 Mar 2012 14:17:55 -0500 Subject: [svn-r22169] Description: Clean up formatting and whitespace. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (too minor to require h5committest) --- tools/h5stat/h5stat.c | 281 ++++++++++++++++++++++++-------------------------- 1 file changed, 137 insertions(+), 144 deletions(-) diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index e206f4f..99ea688 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -99,17 +99,17 @@ typedef struct iter_t { hsize_t attrs_heap_storage_size; /* fractal heap size for attributes (1.8) */ hsize_t SM_hdr_storage_size; /* header size for SOHM table (1.8) */ hsize_t SM_index_storage_size; /* index (btree & list) size for SOHM table (1.8) */ - hsize_t SM_heap_storage_size; /* fractal heap size for SOHM table (1.8) */ - hsize_t super_size; /* superblock size */ - hsize_t super_ext_size; /* superblock extension size */ - hsize_t ublk_size; /* user block size (if exists) */ - H5F_file_space_type_t fs_strategy; /* File space management strategy */ - hsize_t fs_threshold; /* Free-space section threshold */ - hsize_t free_space; /* amount of freespace in the file */ - hsize_t free_hdr; /* size of free space manager metadata in the file */ + hsize_t SM_heap_storage_size; /* fractal heap size for SOHM table (1.8) */ + hsize_t super_size; /* superblock size */ + hsize_t super_ext_size; /* superblock extension size */ + hsize_t ublk_size; /* user block size (if exists) */ + H5F_file_space_type_t fs_strategy; /* File space management strategy */ + hsize_t fs_threshold; /* Free-space section threshold */ + hsize_t free_space; /* amount of freespace in the file */ + hsize_t free_hdr; /* size of free space manager metadata in the file */ unsigned long num_small_sects[SIZE_SMALL_SECTS]; /* Size of small free-space sections */ - unsigned sect_nbins; /* Number of bins for free-space section sizes */ - unsigned long *sect_bins; /* Pointer to array of bins for free-space section sizes */ + unsigned sect_nbins; /* Number of bins for free-space section sizes */ + unsigned long *sect_bins; /* Pointer to array of bins for free-space section sizes */ hsize_t datasets_index_storage_size;/* meta size for chunked dataset's indexing type */ hsize_t datasets_heap_storage_size; /* heap size for dataset with external storage */ unsigned long nexternal; /* Number of external files for a dataset */ @@ -120,11 +120,11 @@ typedef struct iter_t { static int display_all = TRUE; /* Enable the printing of selected statistics */ -static int display_file = FALSE; /* display file information */ -static int display_group = FALSE; /* display groups information */ -static int display_dset = FALSE; /* display datasets information */ +static int display_file = FALSE; /* display file information */ +static int display_group = FALSE; /* display groups information */ +static int display_dset = FALSE; /* display datasets information */ static int display_dset_dtype_meta = FALSE; /* display datasets' datatype information */ -static int display_attr = FALSE; /* display attributes information */ +static int display_attr = FALSE; /* display attributes information */ static int display_free_sections = FALSE; /* display free space information */ static int display_summary = FALSE; /* display summary of file space information */ @@ -283,7 +283,7 @@ ceil_log10(unsigned long x) } /* end while */ return(ret); -} +} /* ceil_log10() */ /*------------------------------------------------------------------------- @@ -481,7 +481,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) /* Object header's total size for H5D_COMPACT layout includes raw data size */ /* "storage" also includes H5D_COMPACT raw data size */ if(lout == H5D_COMPACT) - iter->dset_ohdr_info.total_size -= storage; + iter->dset_ohdr_info.total_size -= storage; /* Track the layout type for dataset */ (iter->dset_layouts[lout])++; @@ -495,7 +495,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) iter->nexternal += (unsigned long)num_ext; iter->dset_external_storage_size += (unsigned long)storage; } else - iter->dset_storage_size += storage; + iter->dset_storage_size += storage; /* Gather dataspace statistics */ sid = H5Dget_space(did); @@ -602,6 +602,7 @@ dataset_stats(iter_t *iter, const char *name, const H5O_info_t *oi) return 0; } /* end dataset_stats() */ + /*------------------------------------------------------------------------- * Function: datatype_stats * @@ -791,11 +792,6 @@ freespace_stats(hid_t fid, iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * Vailin Choi; October 2009 - * Turn on display_group_metadata, display_dset_metadata - * Add 'S' & 's' for printing free space info (previous checkin) - * *------------------------------------------------------------------------- */ static struct handler_t * @@ -812,103 +808,103 @@ parse_command_line(int argc, const char *argv[]) /* parse command line options */ while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { - switch ((char) opt) { - case 'h': - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } - goto done; - break; + switch ((char)opt) { + case 'h': + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + if (hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + } + goto done; + break; - case 'V': - print_version(h5tools_getprogname()); - h5tools_setstatus(EXIT_SUCCESS); - if (hand) { - for (i = 0; i < argc; i++) - if(hand[i].obj) { - free(hand[i].obj); - hand[i].obj=NULL; - } - - free(hand); - hand = NULL; - } - goto done; - break; + case 'V': + print_version(h5tools_getprogname()); + h5tools_setstatus(EXIT_SUCCESS); + if (hand) { + for (i = 0; i < argc; i++) + if(hand[i].obj) { + free(hand[i].obj); + hand[i].obj=NULL; + } + + free(hand); + hand = NULL; + } + goto done; + break; - case 'F': - display_all = FALSE; - display_file_metadata = TRUE; - break; + case 'F': + display_all = FALSE; + display_file_metadata = TRUE; + break; - case 'f': - display_all = FALSE; - display_file = TRUE; - break; + case 'f': + display_all = FALSE; + display_file = TRUE; + break; - case 'G': - display_all = FALSE; - display_group_metadata = TRUE; - break; + case 'G': + display_all = FALSE; + display_group_metadata = TRUE; + break; - case 'g': - display_all = FALSE; - display_group = TRUE; - break; + case 'g': + display_all = FALSE; + display_group = TRUE; + break; - case 'D': - display_all = FALSE; - display_dset_metadata = TRUE; - break; + case 'D': + display_all = FALSE; + display_dset_metadata = TRUE; + break; - case 'd': - display_all = FALSE; - display_dset = TRUE; - break; + case 'd': + display_all = FALSE; + display_dset = TRUE; + break; - case 'T': - display_all = FALSE; - display_dset_dtype_meta = TRUE; - break; + case 'T': + display_all = FALSE; + display_dset_dtype_meta = TRUE; + break; - case 'A': - display_all = FALSE; - display_attr = TRUE; - break; + case 'A': + display_all = FALSE; + display_attr = TRUE; + break; - case 's': - display_all = FALSE; - display_free_sections = TRUE; - break; + case 's': + display_all = FALSE; + display_free_sections = TRUE; + break; - case 'S': - display_all = FALSE; - display_summary = TRUE; - break; + case 'S': + display_all = FALSE; + display_summary = TRUE; + break; - case 'O': - display_all = FALSE; - display_object = TRUE; - for (i = 0; i < argc; i++) - if (!hand[i].obj) { - hand[i].obj = HDstrdup(opt_arg); - break; - } /* end if */ - break; + case 'O': + display_all = FALSE; + display_object = TRUE; + for(i = 0; i < argc; i++) + if(!hand[i].obj) { + hand[i].obj = HDstrdup(opt_arg); + break; + } /* end if */ + break; - default: - usage(h5tools_getprogname()); - h5tools_setstatus(EXIT_FAILURE); - goto error; + default: + usage(h5tools_getprogname()); + h5tools_setstatus(EXIT_FAILURE); + goto error; } /* end switch */ } /* end while */ @@ -964,7 +960,7 @@ iter_init(iter_t *iter, hid_t fid) iter->fid = fid; return 0; -} +} /* iter_init() */ /*------------------------------------------------------------------------- @@ -1174,7 +1170,7 @@ print_group_metadata(const iter_t *iter) printf("File space information for groups' metadata (in bytes):\n"); HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); + iter->group_ohdr_info.total_size, iter->group_ohdr_info.free_size); HDfprintf(stdout, "\tB-tree/List: %Hu\n", iter->groups_btree_storage_size); HDfprintf(stdout, "\tHeap: %Hu\n", iter->groups_heap_storage_size); @@ -1195,8 +1191,6 @@ print_group_metadata(const iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t @@ -1292,10 +1286,10 @@ print_dset_metadata(const iter_t *iter) printf("File space information for datasets' metadata (in bytes):\n"); HDfprintf(stdout, "\tObject headers (total/unused): %Hu/%Hu\n", - iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); + iter->dset_ohdr_info.total_size, iter->dset_ohdr_info.free_size); HDfprintf(stdout, "\tIndex for Chunked datasets: %Hu\n", - iter->datasets_index_storage_size); + iter->datasets_index_storage_size); HDfprintf(stdout, "\tHeap: %Hu\n", iter->datasets_heap_storage_size); return 0; @@ -1311,11 +1305,7 @@ print_dset_metadata(const iter_t *iter) * * Failure: Never fails * - * Programmer: - * - * Modifications: - * Vailin Choi; October 2009 - * Moved from print_dataset_info() + * Programmer: Vailin Choi; October 2009 * *------------------------------------------------------------------------- */ @@ -1327,21 +1317,21 @@ print_dset_dtype_meta(const iter_t *iter) unsigned u; /* Local index variable */ if(iter->dset_ntypes) { - printf("Dataset datatype information:\n"); - printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); - total = 0; - for(u = 0; u < iter->dset_ntypes; u++) { - H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); - printf("\tDataset datatype #%u:\n", u); - printf("\t\tCount (total/named) = (%lu/%lu)\n", - iter->dset_type_info[u].count, iter->dset_type_info[u].named); - printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, - (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); - H5Tclose(iter->dset_type_info[u].tid); - total += iter->dset_type_info[u].count; - } /* end for */ - printf("\tTotal dataset datatype count: %lu\n", total); - } + printf("Dataset datatype information:\n"); + printf("\t# of unique datatypes used by datasets: %lu\n", iter->dset_ntypes); + total = 0; + for(u = 0; u < iter->dset_ntypes; u++) { + H5Tencode(iter->dset_type_info[u].tid, NULL, &dtype_size); + printf("\tDataset datatype #%u:\n", u); + printf("\t\tCount (total/named) = (%lu/%lu)\n", + iter->dset_type_info[u].count, iter->dset_type_info[u].named); + printf("\t\tSize (desc./elmt) = (%lu/%lu)\n", (unsigned long)dtype_size, + (unsigned long)H5Tget_size(iter->dset_type_info[u].tid)); + H5Tclose(iter->dset_type_info[u].tid); + total += iter->dset_type_info[u].count; + } /* end for */ + printf("\tTotal dataset datatype count: %lu\n", total); + } /* end if */ return 0; } /* print_dset_dtype_meta() */ @@ -1446,7 +1436,7 @@ print_freespace_info(const iter_t *iter) return 0; } /* print_freespace_info() */ - + /*------------------------------------------------------------------------- * Function: print_storage_summary * @@ -1492,7 +1482,7 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " Amount/Percent of tracked free space: %Hu bytes/%3.1f%\n", iter->free_space, percent); - if(iter->filesize < (total_meta+iter->dset_storage_size+iter->free_space)) { + if(iter->filesize < (total_meta + iter->dset_storage_size + iter->free_space)) { unaccount = (total_meta + iter->dset_storage_size + iter->free_space) - iter->filesize; HDfprintf(stdout, " ??? File has %Hu more bytes accounted for than its size! ???\n", unaccount); } @@ -1501,12 +1491,11 @@ print_storage_summary(const iter_t *iter) HDfprintf(stdout, " Unaccounted space: %Hu bytes\n", unaccount); } - HDfprintf(stdout, "Total space: %Hu bytes\n", total_meta+iter->dset_storage_size+iter->free_space+unaccount); + HDfprintf(stdout, "Total space: %Hu bytes\n", total_meta + iter->dset_storage_size + iter->free_space + unaccount); if(iter->nexternal) HDfprintf(stdout, "External raw data: %Hu bytes\n", iter->dset_external_storage_size); - return 0; } /* print_storage_summary() */ @@ -1523,11 +1512,6 @@ print_storage_summary(const iter_t *iter) * Programmer: Elena Pourmal * Saturday, August 12, 2006 * - * Modifications: - * Vailin Choi; October 2009 - * Activate "display_group_metadata", "dislay_dset_metadata" and - * "display_dset_dtype_info". - * *------------------------------------------------------------------------- */ static void @@ -1560,7 +1544,7 @@ print_file_statistics(const iter_t *iter) if(display_attr) print_attr_info(iter); if(display_free_sections) print_freespace_info(iter); if(display_summary) print_storage_summary(iter); -} +} /* print_file_statistics() */ /*------------------------------------------------------------------------- @@ -1583,7 +1567,7 @@ static void print_object_statistics(const char *name) { printf("Object name %s\n", name); -} +} /* print_object_statistics() */ /*------------------------------------------------------------------------- @@ -1609,9 +1593,18 @@ print_statistics(const char *name, const iter_t *iter) print_object_statistics(name); else print_file_statistics(iter); -} +} /* print_statistics() */ +/*------------------------------------------------------------------------- + * Function: main + * + * Modifications: + * 2/2010; Vailin Choi + * Get the size of user block + * + *------------------------------------------------------------------------- + */ int main(int argc, const char *argv[]) { -- cgit v0.12 From f1df456412c935f399405960348d02d804b81f2e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 28 Mar 2012 14:30:59 -0500 Subject: [svn-r22170] Removed extraneous svn executable properties from non-executable files. --- c++/COPYING | 0 c++/examples/run-c++-ex.sh.in | 0 c++/examples/testh5c++.sh.in | 0 c++/src/h5c++.in | 0 config/COPYING | 0 config/Makefile.am.blank | 0 examples/run-c-ex.sh.in | 0 examples/testh5cc.sh.in | 0 fortran/COPYING | 0 fortran/examples/run-fortran-ex.sh.in | 0 fortran/examples/testh5fc.sh.in | 0 fortran/src/h5fc.in | 0 hl/COPYING | 0 hl/Makefile.in | 0 hl/c++/COPYING | 0 hl/c++/examples/run-hlc++-ex.sh.in | 0 hl/examples/run-hlc-ex.sh.in | 0 hl/fortran/COPYING | 0 hl/fortran/examples/run-hlfortran-ex.sh.in | 0 hl/fortran/src/H5DSfc.c | 0 hl/fortran/src/H5DSff.f90 | 0 hl/fortran/src/H5IMfc.c | 0 hl/fortran/src/H5IMff.f90 | 0 hl/fortran/src/H5LTf90proto.h | 0 hl/fortran/src/H5LTfc.c | 0 hl/fortran/src/H5LTff.f90 | 0 hl/fortran/src/H5TBfc.c | 0 hl/fortran/src/H5TBff.f90 | 0 hl/fortran/test/tstimage.f90 | 0 hl/fortran/test/tsttable.f90 | 0 hl/src/COPYING | 0 hl/tools/COPYING | 0 perform/COPYING | 0 src/H5Pocpl.c | 0 src/H5Pocpypl.c | 0 src/H5SM.c | 0 src/H5SMbtree2.c | 0 src/H5SMpkg.h | 0 src/H5SMprivate.h | 0 src/Makefile.am | 0 src/hdf5.lnt | 0 testpar/COPYING | 0 tools/COPYING | 0 tools/h5diff/testfiles/h5diff_101w.txt | 0 tools/h5diff/testfiles/h5diff_102w.txt | 0 tools/h5diff/testfiles/h5diff_300.txt | 0 tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 | Bin tools/h5diff/testfiles/h5diff_links.h5 | Bin tools/h5dump/testh5dumpxml.sh.in | 0 tools/h5import/Makefile.in | 0 tools/h5import/h5import.c | 0 tools/h5import/h5import.h | 0 tools/h5import/h5importtest.c | 0 tools/h5import/testfiles/binfp64.conf | 0 tools/h5import/testfiles/binin16.conf | 0 tools/h5import/testfiles/binin32.conf | 0 tools/h5import/testfiles/binin8.conf | 0 tools/h5import/testfiles/binuin16.conf | 0 tools/h5import/testfiles/binuin32.conf | 0 tools/h5import/testfiles/txtfp32.conf | 0 tools/h5import/testfiles/txtfp32.txt | 0 tools/h5import/testfiles/txtfp64.conf | 0 tools/h5import/testfiles/txtfp64.txt | 0 tools/h5import/testfiles/txtin16.conf | 0 tools/h5import/testfiles/txtin32.conf | 0 tools/h5import/testfiles/txtin8.conf | 0 tools/h5import/testfiles/txtuin16.conf | 0 tools/h5import/testfiles/txtuin32.conf | 0 tools/h5import/testfiles/txtuin32.txt | 0 tools/h5jam/testfiles/u10.txt | 0 tools/h5jam/testfiles/u511.txt | 0 tools/h5jam/testfiles/u512.txt | 0 tools/h5jam/testfiles/u513.txt | 0 tools/h5repack/h5repack.sh.in | 0 tools/misc/h5cc.in | 0 tools/misc/h5redeploy.in | 0 vms/COPYING | 0 windows/COPYING | 0 windows/examples/testExamples_exp_output.txt | 0 79 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 c++/COPYING mode change 100755 => 100644 c++/examples/run-c++-ex.sh.in mode change 100755 => 100644 c++/examples/testh5c++.sh.in mode change 100755 => 100644 c++/src/h5c++.in mode change 100755 => 100644 config/COPYING mode change 100755 => 100644 config/Makefile.am.blank mode change 100755 => 100644 examples/run-c-ex.sh.in mode change 100755 => 100644 examples/testh5cc.sh.in mode change 100755 => 100644 fortran/COPYING mode change 100755 => 100644 fortran/examples/run-fortran-ex.sh.in mode change 100755 => 100644 fortran/examples/testh5fc.sh.in mode change 100755 => 100644 fortran/src/h5fc.in mode change 100755 => 100644 hl/COPYING mode change 100755 => 100644 hl/Makefile.in mode change 100755 => 100644 hl/c++/COPYING mode change 100755 => 100644 hl/c++/examples/run-hlc++-ex.sh.in mode change 100755 => 100644 hl/examples/run-hlc-ex.sh.in mode change 100755 => 100644 hl/fortran/COPYING mode change 100755 => 100644 hl/fortran/examples/run-hlfortran-ex.sh.in mode change 100755 => 100644 hl/fortran/src/H5DSfc.c mode change 100755 => 100644 hl/fortran/src/H5DSff.f90 mode change 100755 => 100644 hl/fortran/src/H5IMfc.c mode change 100755 => 100644 hl/fortran/src/H5IMff.f90 mode change 100755 => 100644 hl/fortran/src/H5LTf90proto.h mode change 100755 => 100644 hl/fortran/src/H5LTfc.c mode change 100755 => 100644 hl/fortran/src/H5LTff.f90 mode change 100755 => 100644 hl/fortran/src/H5TBfc.c mode change 100755 => 100644 hl/fortran/src/H5TBff.f90 mode change 100755 => 100644 hl/fortran/test/tstimage.f90 mode change 100755 => 100644 hl/fortran/test/tsttable.f90 mode change 100755 => 100644 hl/src/COPYING mode change 100755 => 100644 hl/tools/COPYING mode change 100755 => 100644 perform/COPYING mode change 100755 => 100644 src/H5Pocpl.c mode change 100755 => 100644 src/H5Pocpypl.c mode change 100755 => 100644 src/H5SM.c mode change 100755 => 100644 src/H5SMbtree2.c mode change 100755 => 100644 src/H5SMpkg.h mode change 100755 => 100644 src/H5SMprivate.h mode change 100755 => 100644 src/Makefile.am mode change 100755 => 100644 src/hdf5.lnt mode change 100755 => 100644 testpar/COPYING mode change 100755 => 100644 tools/COPYING mode change 100755 => 100644 tools/h5diff/testfiles/h5diff_101w.txt mode change 100755 => 100644 tools/h5diff/testfiles/h5diff_102w.txt mode change 100755 => 100644 tools/h5diff/testfiles/h5diff_300.txt mode change 100755 => 100644 tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 mode change 100755 => 100644 tools/h5diff/testfiles/h5diff_links.h5 mode change 100755 => 100644 tools/h5dump/testh5dumpxml.sh.in mode change 100755 => 100644 tools/h5import/Makefile.in mode change 100755 => 100644 tools/h5import/h5import.c mode change 100755 => 100644 tools/h5import/h5import.h mode change 100755 => 100644 tools/h5import/h5importtest.c mode change 100755 => 100644 tools/h5import/testfiles/binfp64.conf mode change 100755 => 100644 tools/h5import/testfiles/binin16.conf mode change 100755 => 100644 tools/h5import/testfiles/binin32.conf mode change 100755 => 100644 tools/h5import/testfiles/binin8.conf mode change 100755 => 100644 tools/h5import/testfiles/binuin16.conf mode change 100755 => 100644 tools/h5import/testfiles/binuin32.conf mode change 100755 => 100644 tools/h5import/testfiles/txtfp32.conf mode change 100755 => 100644 tools/h5import/testfiles/txtfp32.txt mode change 100755 => 100644 tools/h5import/testfiles/txtfp64.conf mode change 100755 => 100644 tools/h5import/testfiles/txtfp64.txt mode change 100755 => 100644 tools/h5import/testfiles/txtin16.conf mode change 100755 => 100644 tools/h5import/testfiles/txtin32.conf mode change 100755 => 100644 tools/h5import/testfiles/txtin8.conf mode change 100755 => 100644 tools/h5import/testfiles/txtuin16.conf mode change 100755 => 100644 tools/h5import/testfiles/txtuin32.conf mode change 100755 => 100644 tools/h5import/testfiles/txtuin32.txt mode change 100755 => 100644 tools/h5jam/testfiles/u10.txt mode change 100755 => 100644 tools/h5jam/testfiles/u511.txt mode change 100755 => 100644 tools/h5jam/testfiles/u512.txt mode change 100755 => 100644 tools/h5jam/testfiles/u513.txt mode change 100755 => 100644 tools/h5repack/h5repack.sh.in mode change 100755 => 100644 tools/misc/h5cc.in mode change 100755 => 100644 tools/misc/h5redeploy.in mode change 100755 => 100644 vms/COPYING mode change 100755 => 100644 windows/COPYING mode change 100755 => 100644 windows/examples/testExamples_exp_output.txt diff --git a/c++/COPYING b/c++/COPYING old mode 100755 new mode 100644 diff --git a/c++/examples/run-c++-ex.sh.in b/c++/examples/run-c++-ex.sh.in old mode 100755 new mode 100644 diff --git a/c++/examples/testh5c++.sh.in b/c++/examples/testh5c++.sh.in old mode 100755 new mode 100644 diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in old mode 100755 new mode 100644 diff --git a/config/COPYING b/config/COPYING old mode 100755 new mode 100644 diff --git a/config/Makefile.am.blank b/config/Makefile.am.blank old mode 100755 new mode 100644 diff --git a/examples/run-c-ex.sh.in b/examples/run-c-ex.sh.in old mode 100755 new mode 100644 diff --git a/examples/testh5cc.sh.in b/examples/testh5cc.sh.in old mode 100755 new mode 100644 diff --git a/fortran/COPYING b/fortran/COPYING old mode 100755 new mode 100644 diff --git a/fortran/examples/run-fortran-ex.sh.in b/fortran/examples/run-fortran-ex.sh.in old mode 100755 new mode 100644 diff --git a/fortran/examples/testh5fc.sh.in b/fortran/examples/testh5fc.sh.in old mode 100755 new mode 100644 diff --git a/fortran/src/h5fc.in b/fortran/src/h5fc.in old mode 100755 new mode 100644 diff --git a/hl/COPYING b/hl/COPYING old mode 100755 new mode 100644 diff --git a/hl/Makefile.in b/hl/Makefile.in old mode 100755 new mode 100644 diff --git a/hl/c++/COPYING b/hl/c++/COPYING old mode 100755 new mode 100644 diff --git a/hl/c++/examples/run-hlc++-ex.sh.in b/hl/c++/examples/run-hlc++-ex.sh.in old mode 100755 new mode 100644 diff --git a/hl/examples/run-hlc-ex.sh.in b/hl/examples/run-hlc-ex.sh.in old mode 100755 new mode 100644 diff --git a/hl/fortran/COPYING b/hl/fortran/COPYING old mode 100755 new mode 100644 diff --git a/hl/fortran/examples/run-hlfortran-ex.sh.in b/hl/fortran/examples/run-hlfortran-ex.sh.in old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5DSfc.c b/hl/fortran/src/H5DSfc.c old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5DSff.f90 b/hl/fortran/src/H5DSff.f90 old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5IMff.f90 b/hl/fortran/src/H5IMff.f90 old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c old mode 100755 new mode 100644 diff --git a/hl/fortran/src/H5TBff.f90 b/hl/fortran/src/H5TBff.f90 old mode 100755 new mode 100644 diff --git a/hl/fortran/test/tstimage.f90 b/hl/fortran/test/tstimage.f90 old mode 100755 new mode 100644 diff --git a/hl/fortran/test/tsttable.f90 b/hl/fortran/test/tsttable.f90 old mode 100755 new mode 100644 diff --git a/hl/src/COPYING b/hl/src/COPYING old mode 100755 new mode 100644 diff --git a/hl/tools/COPYING b/hl/tools/COPYING old mode 100755 new mode 100644 diff --git a/perform/COPYING b/perform/COPYING old mode 100755 new mode 100644 diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c old mode 100755 new mode 100644 diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c old mode 100755 new mode 100644 diff --git a/src/H5SM.c b/src/H5SM.c old mode 100755 new mode 100644 diff --git a/src/H5SMbtree2.c b/src/H5SMbtree2.c old mode 100755 new mode 100644 diff --git a/src/H5SMpkg.h b/src/H5SMpkg.h old mode 100755 new mode 100644 diff --git a/src/H5SMprivate.h b/src/H5SMprivate.h old mode 100755 new mode 100644 diff --git a/src/Makefile.am b/src/Makefile.am old mode 100755 new mode 100644 diff --git a/src/hdf5.lnt b/src/hdf5.lnt old mode 100755 new mode 100644 diff --git a/testpar/COPYING b/testpar/COPYING old mode 100755 new mode 100644 diff --git a/tools/COPYING b/tools/COPYING old mode 100755 new mode 100644 diff --git a/tools/h5diff/testfiles/h5diff_101w.txt b/tools/h5diff/testfiles/h5diff_101w.txt old mode 100755 new mode 100644 diff --git a/tools/h5diff/testfiles/h5diff_102w.txt b/tools/h5diff/testfiles/h5diff_102w.txt old mode 100755 new mode 100644 diff --git a/tools/h5diff/testfiles/h5diff_300.txt b/tools/h5diff/testfiles/h5diff_300.txt old mode 100755 new mode 100644 diff --git a/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 b/tools/h5diff/testfiles/h5diff_enum_invalid_values.h5 old mode 100755 new mode 100644 diff --git a/tools/h5diff/testfiles/h5diff_links.h5 b/tools/h5diff/testfiles/h5diff_links.h5 old mode 100755 new mode 100644 diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in old mode 100755 new mode 100644 diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in old mode 100755 new mode 100644 diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c old mode 100755 new mode 100644 diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h old mode 100755 new mode 100644 diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binfp64.conf b/tools/h5import/testfiles/binfp64.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binin16.conf b/tools/h5import/testfiles/binin16.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binin32.conf b/tools/h5import/testfiles/binin32.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binin8.conf b/tools/h5import/testfiles/binin8.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binuin16.conf b/tools/h5import/testfiles/binuin16.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/binuin32.conf b/tools/h5import/testfiles/binuin32.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtfp32.conf b/tools/h5import/testfiles/txtfp32.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtfp32.txt b/tools/h5import/testfiles/txtfp32.txt old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtfp64.conf b/tools/h5import/testfiles/txtfp64.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtfp64.txt b/tools/h5import/testfiles/txtfp64.txt old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtin16.conf b/tools/h5import/testfiles/txtin16.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtin32.conf b/tools/h5import/testfiles/txtin32.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtin8.conf b/tools/h5import/testfiles/txtin8.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtuin16.conf b/tools/h5import/testfiles/txtuin16.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtuin32.conf b/tools/h5import/testfiles/txtuin32.conf old mode 100755 new mode 100644 diff --git a/tools/h5import/testfiles/txtuin32.txt b/tools/h5import/testfiles/txtuin32.txt old mode 100755 new mode 100644 diff --git a/tools/h5jam/testfiles/u10.txt b/tools/h5jam/testfiles/u10.txt old mode 100755 new mode 100644 diff --git a/tools/h5jam/testfiles/u511.txt b/tools/h5jam/testfiles/u511.txt old mode 100755 new mode 100644 diff --git a/tools/h5jam/testfiles/u512.txt b/tools/h5jam/testfiles/u512.txt old mode 100755 new mode 100644 diff --git a/tools/h5jam/testfiles/u513.txt b/tools/h5jam/testfiles/u513.txt old mode 100755 new mode 100644 diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in old mode 100755 new mode 100644 diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in old mode 100755 new mode 100644 diff --git a/tools/misc/h5redeploy.in b/tools/misc/h5redeploy.in old mode 100755 new mode 100644 diff --git a/vms/COPYING b/vms/COPYING old mode 100755 new mode 100644 diff --git a/windows/COPYING b/windows/COPYING old mode 100755 new mode 100644 diff --git a/windows/examples/testExamples_exp_output.txt b/windows/examples/testExamples_exp_output.txt old mode 100755 new mode 100644 -- cgit v0.12 From 35a0e27e885e63c40449483733c105649e3c99dc Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 28 Mar 2012 14:45:49 -0500 Subject: [svn-r22171] Description: Bring "merge committed datatypes during H5Ocopy" feature from branch to trunk. (Also has some minor bugfixes with it) Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (h5committest coming up) --- release_docs/RELEASE.txt | 4 + src/H5A.c | 30 + src/H5Apkg.h | 26 - src/H5Aprivate.h | 32 + src/H5Oainfo.c | 14 +- src/H5Oattr.c | 1 + src/H5Oattribute.c | 5 +- src/H5Ocopy.c | 778 ++++++++++- src/H5Odtype.c | 38 + src/H5Oefl.c | 8 +- src/H5Ofill.c | 2 + src/H5Olayout.c | 8 +- src/H5Olinfo.c | 16 +- src/H5Olink.c | 16 +- src/H5Omessage.c | 6 +- src/H5Opkg.h | 12 +- src/H5Opline.c | 1 + src/H5Oprivate.h | 22 +- src/H5Opublic.h | 11 +- src/H5Osdspace.c | 1 + src/H5Oshared.c | 17 +- src/H5Oshared.h | 21 +- src/H5Ostab.c | 18 +- src/H5Pdcpl.c | 2 +- src/H5Pocpypl.c | 443 ++++++- src/H5Ppublic.h | 5 + src/H5SM.c | 5 +- test/objcopy.c | 3221 +++++++++++++++++++++++++++++++++++++++++++++- 28 files changed, 4621 insertions(+), 142 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 6c61597..58ad605 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -392,6 +392,10 @@ Bug Fixes since HDF5-1.8.0 release 2012/1/25. Issue 7756) - Fixed a seg fault that could occur when shrinking a dataset with chunks larger than 1 MB. (NAF - 2011/11/30 - HDFFV-7833) + - Fixed a bug that could cause file corruption when copying named + datatypes to a file using shared messages. (NAF - 2011/11/14) + - Fixed a bug that could cause H5Oget_info to return the wrong address + after copying a named datatype. (NAF - 2011/11/14) - The library allowed the conversion of strings between ASCII and UTF8 (Issue 7582). We have corrected it to report an error under this situation. (SLU - 2011/11/8) diff --git a/src/H5A.c b/src/H5A.c index cc6a7a5..63a908d 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -2523,6 +2523,36 @@ done: /*------------------------------------------------------------------------- + * Function: H5A_type + * + * Purpose: Return the datatype for an attribute. + * + * Return: Success: Ptr to entry + * Failure: NULL + * + * Programmer: Neil Fortner + * Friday, November 11, 2011 + * + *------------------------------------------------------------------------- + */ +H5T_t * +H5A_type(const H5A_t *attr) +{ + H5T_t *ret_value; /* Return value */ + + FUNC_ENTER_NOAPI(NULL) + + HDassert(attr); + + /* Set return value */ + ret_value = attr->shared->dt; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5A_type() */ + + +/*------------------------------------------------------------------------- * Function: H5Aexists * * Purpose: Checks if an attribute with a given name exists on an opened diff --git a/src/H5Apkg.h b/src/H5Apkg.h index 20aa5b9..26c8dff 100644 --- a/src/H5Apkg.h +++ b/src/H5Apkg.h @@ -158,29 +158,6 @@ typedef struct { H5A_t **attrs; /* Pointer to array of attribute pointers */ } H5A_attr_table_t; -/* Attribute iteration operator for internal library callbacks */ -typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data); - -/* Describe kind of callback to make for each attribute */ -typedef enum H5A_attr_iter_op_type_t { -#ifndef H5_NO_DEPRECATED_SYMBOLS - H5A_ATTR_OP_APP, /* Application callback */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5A_ATTR_OP_APP2, /* Revised application callback */ - H5A_ATTR_OP_LIB /* Library internal callback */ -} H5A_attr_iter_op_type_t; - -typedef struct H5A_attr_iter_op_t { - H5A_attr_iter_op_type_t op_type; - union { -#ifndef H5_NO_DEPRECATED_SYMBOLS - H5A_operator1_t app_op; /* Application callback for each attribute */ -#endif /* H5_NO_DEPRECATED_SYMBOLS */ - H5A_operator2_t app_op2; /* Revised application callback for each attribute */ - H5A_lib_iterate_t lib_op; /* Library internal callback for each attribute */ - } u; -} H5A_attr_iter_op_t; - /*****************************/ /* Package Private Variables */ @@ -268,9 +245,6 @@ H5_DLL herr_t H5O_attr_write(const H5O_loc_t *loc, hid_t dxpl_id, H5A_t *attr); H5_DLL herr_t H5O_attr_rename(const H5O_loc_t *loc, hid_t dxpl_id, const char *old_name, const char *new_name); -H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type, - H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, - const H5A_attr_iter_op_t *op, void *op_data); H5_DLL herr_t H5O_attr_remove(const H5O_loc_t *loc, const char *name, hid_t dxpl_id); H5_DLL herr_t H5O_attr_remove_by_idx(const H5O_loc_t *loc, H5_index_t idx_type, diff --git a/src/H5Aprivate.h b/src/H5Aprivate.h index 0c0e519..6646fa2 100644 --- a/src/H5Aprivate.h +++ b/src/H5Aprivate.h @@ -24,6 +24,8 @@ /* Private headers needed by this file */ #include "H5Gprivate.h" /* Groups */ +#include "H5Oprivate.h" /* Object headers */ +#include "H5Tprivate.h" /* Datatypes */ /**************************/ @@ -38,6 +40,29 @@ /* Forward references of package typedefs */ typedef struct H5A_t H5A_t; +/* Attribute iteration operator for internal library callbacks */ +typedef herr_t (*H5A_lib_iterate_t)(const H5A_t *attr, void *op_data); + +/* Describe kind of callback to make for each attribute */ +typedef enum H5A_attr_iter_op_type_t { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5A_ATTR_OP_APP, /* Application callback */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5A_ATTR_OP_APP2, /* Revised application callback */ + H5A_ATTR_OP_LIB /* Library internal callback */ +} H5A_attr_iter_op_type_t; + +typedef struct H5A_attr_iter_op_t { + H5A_attr_iter_op_type_t op_type; + union { +#ifndef H5_NO_DEPRECATED_SYMBOLS + H5A_operator1_t app_op; /* Application callback for each attribute */ +#endif /* H5_NO_DEPRECATED_SYMBOLS */ + H5A_operator2_t app_op2; /* Revised application callback for each attribute */ + H5A_lib_iterate_t lib_op; /* Library internal callback for each attribute */ + } u; +} H5A_attr_iter_op_t; + /*****************************/ /* Library-private Variables */ @@ -51,6 +76,13 @@ typedef struct H5A_t H5A_t; /* General attribute routines */ H5_DLL struct H5O_loc_t *H5A_oloc(H5A_t *attr); H5_DLL H5G_name_t *H5A_nameof(H5A_t *attr); +H5_DLL H5T_t *H5A_type(const H5A_t *attr); +H5_DLL herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, + hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, + hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); +H5_DLL herr_t H5O_attr_iterate(hid_t loc_id, hid_t dxpl_id, H5_index_t idx_type, + H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, + const H5A_attr_iter_op_t *op, void *op_data); #endif /* _H5Aprivate_H */ diff --git a/src/H5Oainfo.c b/src/H5Oainfo.c index ff4cc5d..b207ea2 100644 --- a/src/H5Oainfo.c +++ b/src/H5Oainfo.c @@ -46,11 +46,11 @@ static herr_t H5O_ainfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, static herr_t H5O_ainfo_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, - hid_t dxpl_id); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, - const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, - H5O_copy_t *cpy_info); + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); static herr_t H5O_ainfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -403,7 +403,8 @@ H5O_ainfo_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_ainfo_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t *cpy_info, void UNUSED *udata, hid_t dxpl_id) { H5O_ainfo_t *ainfo_src = (H5O_ainfo_t *)mesg_src; H5O_ainfo_t *ainfo_dst = NULL; @@ -468,7 +469,8 @@ done: */ static herr_t H5O_ainfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_ainfo_t *ainfo_src = (const H5O_ainfo_t *)mesg_src; herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 8cd243b..510d64f 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -61,6 +61,7 @@ static herr_t H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_COPY_FILE_REAL H5O_attr_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_attr_shared_post_copy_file #define H5O_SHARED_POST_COPY_FILE_REAL H5O_attr_post_copy_file +#undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_attr_shared_debug #define H5O_SHARED_DEBUG_REAL H5O_attr_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index fbfc140..5778dc1 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -135,9 +135,6 @@ typedef struct { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, - hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, - hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data); static htri_t H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_to_open); @@ -1260,7 +1257,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +herr_t H5O_attr_iterate_real(hid_t loc_id, const H5O_loc_t *loc, hid_t dxpl_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t skip, hsize_t *last_attr, const H5A_attr_iter_op_t *attr_op, void *op_data) diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index e2d792a..7b812ec 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -34,6 +34,7 @@ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ +#include "H5Aprivate.h" /* Attributes */ #include "H5Eprivate.h" /* Error handling */ #include "H5FLprivate.h" /* Free lists */ #include "H5Iprivate.h" /* IDs */ @@ -55,6 +56,20 @@ /* Local Typedefs */ /******************/ +/* Key object for skiplist of committed datatypes */ +typedef struct H5O_copy_search_comm_dt_key_t { + H5T_t *dt; /* Datatype */ + unsigned long fileno; /* File number */ +} H5O_copy_search_comm_dt_key_t; + +/* Callback struct for building a list of committed datatypes */ +typedef struct H5O_copy_search_comm_dt_ud_t { + H5SL_t *dst_dt_list; /* Skip list of committed datatypes */ + H5G_loc_t *dst_root_loc; /* Starting location for iteration */ + H5O_loc_t obj_oloc; /* Object location (for attribute iteration callback) */ + hid_t dxpl_id; /* Dataset transfer property list id */ +} H5O_copy_search_comm_dt_ud_t; + /********************/ /* Package Typedefs */ @@ -66,14 +81,23 @@ /********************/ static herr_t H5O_copy_free_addrmap_cb(void *item, void *key, void *op_data); -static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, +static herr_t H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata); -static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, unsigned cpy_option); +static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + hid_t dxpl_id, hid_t ocpypl_id); static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id); static herr_t H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, H5O_loc_t *dst_oloc, H5G_loc_t *dst_root_loc, H5O_copy_t *cpy_info); +static herr_t H5O_copy_free_comm_dt_cb(void *item, void *key, void *op_data); +static int H5O_copy_comm_dt_cmp(const void *dt1, const void *dt2); +static herr_t H5O_copy_search_comm_dt_cb(hid_t group, const char *name, + const H5L_info_t *linfo, void *udata); +static htri_t H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info); +static herr_t H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); + /*********************/ /* Package Variables */ @@ -82,6 +106,12 @@ static herr_t H5O_copy_obj_by_ref(H5O_loc_t *src_oloc, hid_t dxpl_id, /* Declare a free list to manage the H5O_addr_map_t struct */ H5FL_DEFINE(H5O_addr_map_t); +/* Declare a free list to manage the H5O_copy_search_comm_dt_key_t struct */ +H5FL_DEFINE(H5O_copy_search_comm_dt_key_t); + +/* Declare a free list to manage haddr_t variables */ +H5FL_DEFINE(haddr_t); + /*****************************/ /* Library Private Variables */ @@ -292,8 +322,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, void **udata) +H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, + hid_t dxpl_id, H5O_copy_t *cpy_info, H5O_type_t *obj_type, + void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5O_t *oh_src = NULL; /* Object header for source object */ @@ -356,6 +387,53 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, (NULL == (cpy_udata = (obj_class->get_copy_file_udata)()))) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to retrieve copy user data") + /* If we are merging committed datatypes, check for a match in the destination + * file now */ + if(cpy_info->merge_comm_dt && obj_class->type == H5O_TYPE_NAMED_DATATYPE) { + unsigned long fileno_src; /* fileno for source file */ + unsigned long fileno_dst; /* fileno for destination file */ + htri_t merge; /* Whether we found a match in the destination file */ + + /* Check if the source and dest file are the same. If so, just return + * the source object address */ + H5F_GET_FILENO(oloc_src->file, fileno_src); + H5F_GET_FILENO(oloc_dst->file, fileno_dst); + if(fileno_src == fileno_dst) { + merge = TRUE; + oloc_dst->addr = oloc_src->addr; + } /* end if */ + else + /* Search for a matching committed datatype, building the list if + * necessary */ + if((merge = H5O_copy_search_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info)) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't search for matching committed datatype") + + if(merge) { + /* Found a match, add to skip list and exit */ + /* Allocate space for the address mapping of the object copied */ + if(NULL == (addr_map = H5FL_MALLOC(H5O_addr_map_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Insert the address mapping for the found object into the copied + * list */ + addr_map->src_obj_pos.fileno = fileno_src; + addr_map->src_obj_pos.addr = oloc_src->addr; + addr_map->dst_addr = oloc_dst->addr; + addr_map->is_locked = TRUE; /* We've locked the object currently */ + addr_map->inc_ref_count = 0; /* Start with no additional ref counts to add */ + addr_map->obj_class = obj_class; + addr_map->udata = cpy_udata; + + /* Insert into skip list */ + if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_obj_pos)) < 0) { + addr_map = H5FL_FREE(H5O_addr_map_t, addr_map); + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + } /* end if */ + + HGOTO_DONE(SUCCEED) + } /* end if */ + } /* end if */ + /* Flush any dirty messages in source object header to update the header chunks */ if(H5O_flush_msgs(oloc_src->file, oh_src) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object header messages") @@ -497,38 +575,33 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, /* copy this message into destination file */ if(copy_type->copy_file) { - htri_t is_shared; /* Whether message is shared */ hbool_t recompute_size; /* Whether copy_file callback created a shared message */ + unsigned mesg_flags; /* Message flags */ /* Decode the message if necessary. */ H5O_LOAD_NATIVE(oloc_src->file, dxpl_id, 0, oh_src, mesg_src, FAIL) + /* Get destination message flags, and unset shared and shareable + * flags. mesg_dst->flags will contain the original flags for now. + */ + mesg_flags = (unsigned)mesg_dst->flags & ~H5O_MSG_FLAG_SHARED + & ~H5O_MSG_FLAG_SHAREABLE; + /* Copy the source message */ recompute_size = FALSE; - if((mesg_dst->native = H5O_msg_copy_file(copy_type, - oloc_src->file, mesg_src->native, oloc_dst->file, - &recompute_size, cpy_info, cpy_udata, dxpl_id)) == NULL) + if((mesg_dst->native = H5O_msg_copy_file(copy_type, oloc_src->file, + mesg_src->native, oloc_dst->file, &recompute_size, + &mesg_flags, cpy_info, cpy_udata, dxpl_id)) == NULL) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object header message") - /* Check if new message is shared */ - if((is_shared = H5O_msg_is_shared(copy_type->id, mesg_dst->native)) < 0) - HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to query message's shared status") - - /* In being copied, the message may have become shared or stopped - * being shared, set/unset its sharing flag. + /* Check if the sharing state changed, and recompute the size if so */ - if(is_shared && !(mesg_dst->flags & H5O_MSG_FLAG_SHARED)) { - mesg_dst->flags |= H5O_MSG_FLAG_SHARED; - - /* Recompute message size (mesg_dst->native is really shared) */ - recompute_size = TRUE; - } /* end if */ - else if(!is_shared && (mesg_dst->flags & H5O_MSG_FLAG_SHARED)) { - mesg_dst->flags &= ~H5O_MSG_FLAG_SHARED; - - /* Recompute message size (msg_dest->native is no longer shared) */ + if(!(mesg_flags & H5O_MSG_FLAG_SHARED) + != !(mesg_dst->flags & H5O_MSG_FLAG_SHARED)) recompute_size = TRUE; - } /* end if */ + + /* Set destination message flags */ + mesg_dst->flags = (uint8_t)mesg_flags; /* Recompute message's size */ /* (its sharing status or one of its components (for attributes) @@ -698,6 +771,13 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, oloc_dst->addr = addr_new; + /* If we are merging committed datatypes and this is a committed datatype, insert + * the copied datatype into the list of committed datatypes in the target file. + */ + if(cpy_info->merge_comm_dt && obj_class->type == H5O_TYPE_NAMED_DATATYPE) + if(H5O_copy_insert_comm_dt(oloc_src->file, oh_src, oloc_dst, dxpl_id, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't insert committed datatype into destination list") + /* Allocate space for the address mapping of the object copied */ if(NULL == (addr_map = H5FL_MALLOC(H5O_addr_map_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") @@ -713,8 +793,10 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, addr_map->udata = cpy_udata; /* Insert into skip list */ - if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_obj_pos)) < 0) + if(H5SL_insert(cpy_info->map_list, addr_map, &(addr_map->src_obj_pos)) < 0) { + addr_map = H5FL_FREE(H5O_addr_map_t, addr_map); HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + } /* end if */ /* "post copy" loop over messages, to fix up any messages which require a complete * object header for destination object @@ -743,17 +825,26 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, HDassert(copy_type); if(copy_type->post_copy_file && mesg_src->native) { + unsigned mesg_flags; /* Message flags */ + /* Sanity check destination message */ HDassert(mesg_dst->type == mesg_src->type); HDassert(mesg_dst->native); + /* Get destination message flags. mesg_dst->flags will contain the + * original flags for now. */ + mesg_flags = (unsigned)mesg_dst->flags; + /* the object header is needed in the post copy for shared message */ cpy_info->oh_dst = oh_dst; /* Perform "post copy" operation on message */ if((copy_type->post_copy_file)(oloc_src, mesg_src->native, oloc_dst, - mesg_dst->native, dxpl_id, cpy_info) < 0) + mesg_dst->native, &mesg_flags, dxpl_id, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to perform 'post copy' operation on message") + + /* Verify that the flags did not change */ + HDassert(mesg_flags == (unsigned) mesg_dst->flags); } /* end if */ } /* end for */ @@ -824,9 +915,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, +H5O_copy_header_map(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/, hid_t dxpl_id, H5O_copy_t *cpy_info, hbool_t inc_depth, - H5O_type_t *obj_type, void **udata) + H5O_type_t *obj_type, void **udata /*out*/) { H5O_addr_map_t *addr_map = NULL; /* Address mapping of object copied */ H5_obj_t src_obj_pos; /* Position of source object */ @@ -964,9 +1055,13 @@ H5O_copy_free_addrmap_cb(void *_item, void UNUSED *key, void UNUSED *op_data) */ static herr_t H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, - hid_t dxpl_id, unsigned cpy_option) + hid_t dxpl_id, hid_t ocpypl_id) { H5O_copy_t cpy_info; /* Information for copying object */ + H5P_genplist_t *ocpy_plist; /* Object copy property list created */ + H5O_copy_dtype_merge_list_t *dt_list = NULL; /* List of datatype merge suggestions */ + H5O_mcdt_cb_info_t cb_info; /* Callback info struct */ + unsigned cpy_option = 0; /* Copy options */ herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI_NOINIT @@ -976,6 +1071,22 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, HDassert(H5F_addr_defined(oloc_src->addr)); HDassert(oloc_dst->file); + /* Get the copy property list */ + if(NULL == (ocpy_plist = (H5P_genplist_t *)H5I_object(ocpypl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") + + /* Retrieve the copy parameters */ + if(H5P_get(ocpy_plist, H5O_CPY_OPTION_NAME, &cpy_option) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object copy flag") + + /* Retrieve the marge committed datatype list */ + if(H5P_get(ocpy_plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get merge committed datatype list") + + /* Get callback info */ + if(H5P_get(ocpy_plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get callback info") + /* Convert copy flags into copy struct */ HDmemset(&cpy_info, 0, sizeof(H5O_copy_t)); if((cpy_option & H5O_COPY_SHALLOW_HIERARCHY_FLAG) > 0) { @@ -995,9 +1106,18 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, cpy_info.copy_without_attr = TRUE; if((cpy_option & H5O_COPY_PRESERVE_NULL_FLAG) > 0) cpy_info.preserve_null = TRUE; + if((cpy_option & H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) > 0) + cpy_info.merge_comm_dt = TRUE; + + /* Add dt_list to copy struct */ + cpy_info.dst_dt_suggestion_list = dt_list; + + /* Add set callback information */ + cpy_info.mcdt_cb = cb_info.func; + cpy_info.mcdt_ud = cb_info.user_data; /* Create a skip list to keep track of which objects are copied */ - if((cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL)) == NULL) + if(NULL == (cpy_info.map_list = H5SL_create(H5SL_TYPE_OBJ, NULL))) HGOTO_ERROR(H5E_SLIST, H5E_CANTCREATE, FAIL, "cannot make skip list") /* copy the object from the source file to the destination file */ @@ -1007,6 +1127,8 @@ H5O_copy_header(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */, done: if(cpy_info.map_list) H5SL_destroy(cpy_info.map_list, H5O_copy_free_addrmap_cb, NULL); + if(cpy_info.dst_dt_list) + H5SL_destroy(cpy_info.dst_dt_list, H5O_copy_free_comm_dt_cb, NULL); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_copy_header() */ @@ -1028,14 +1150,12 @@ static herr_t H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id) { - H5P_genplist_t *ocpy_plist=NULL; /* Object copy property list created */ - hid_t dxpl_id=H5AC_dxpl_id; H5G_name_t new_path; /* Copied object group hier. path */ H5O_loc_t new_oloc; /* Copied object object location */ H5G_loc_t new_loc; /* Group location of object copied */ H5F_t *cached_dst_file; /* Cached destination file */ - hbool_t entry_inserted=FALSE; /* Flag to indicate that the new entry was inserted into a group */ - unsigned cpy_option = 0; /* Copy options */ + hbool_t entry_inserted = FALSE; /* Flag to indicate that the new entry was inserted into a group */ + hid_t dxpl_id = H5AC_dxpl_id; /* DXPL for operation */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -1046,14 +1166,6 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, HDassert(dst_loc->oloc->file); HDassert(dst_name); - /* Get the copy property list */ - if(NULL == (ocpy_plist = (H5P_genplist_t *)H5I_object(ocpypl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - - /* Retrieve the copy parameters */ - if(H5P_get(ocpy_plist, H5O_CPY_OPTION_NAME, &cpy_option) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object copy flag") - /* Set up copied object location to fill in */ new_loc.oloc = &new_oloc; new_loc.path = &new_path; @@ -1066,7 +1178,7 @@ H5O_copy_obj(H5G_loc_t *src_loc, H5G_loc_t *dst_loc, const char *dst_name, cached_dst_file = dst_loc->oloc->file; /* Copy the object from the source file to the destination file */ - if(H5O_copy_header(src_loc->oloc, &new_oloc, dxpl_id, cpy_option) < 0) + if(H5O_copy_header(src_loc->oloc, &new_oloc, dxpl_id, ocpypl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy object") /* Patch dst_loc. Again, this can be removed once oloc's point to shared @@ -1282,3 +1394,579 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_copy_expand_ref() */ + +/*------------------------------------------------------------------------- + * Function: H5O_copy_free_comm_dt_cb + * + * Purpose: Frees the merge committed dt skip list key and object. + * + * Return: SUCCEED (never fails) + * + * Programmer: Neil Fortner + * Oct 6 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_copy_free_comm_dt_cb(void *item, void *_key, void UNUSED *op_data) +{ + haddr_t *addr = (haddr_t *)item; + H5O_copy_search_comm_dt_key_t *key = (H5O_copy_search_comm_dt_key_t *)_key; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(addr); + HDassert(key); + HDassert(key->dt); + + key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt); + key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key); + addr = H5FL_FREE(haddr_t, addr); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_copy_free_comm_dt_cb */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_comm_dt_cmp + * + * Purpose: Skiplist callback used to compare 2 keys for the merge + * committed dt list. Mostly a wrapper for H5T_cmp. + * + * Return: 0 if key1 and key2 are equal. + * <0 if key1 is less than key2. + * >0 if key1 is greater than key2. + * + * Programmer: Neil Fortner + * Oct 6 2011 + * + *------------------------------------------------------------------------- + */ +static int +H5O_copy_comm_dt_cmp(const void *_key1, const void *_key2) +{ + const H5O_copy_search_comm_dt_key_t *key1 = (const H5O_copy_search_comm_dt_key_t *)_key1; + const H5O_copy_search_comm_dt_key_t *key2 = (const H5O_copy_search_comm_dt_key_t *)_key2; + int ret_value = 0; + + FUNC_ENTER_NOAPI_NOINIT + + /* Check fileno. It is unlikely to be different so check if they are equal + * first so only one comparison needs to be made. */ + if(key1->fileno != key2->fileno) { + if(key1->fileno < key2->fileno) + HGOTO_DONE(-1) + if(key1->fileno > key2->fileno) + HGOTO_DONE(1) + } /* end if */ + + ret_value = H5T_cmp(key1->dt, key2->dt, FALSE); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_comm_dt_cmp */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_search_comm_dt_attr_cb + * + * Purpose: Callback for H5O_attr_iterate_real from + * H5O_copy_search_comm_dt_check. Checks if the attribute's + * datatype is committed. If it is, adds it to the merge + * committed dt skiplist present in udata if it does not match + * any already present. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * Nov 3 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_copy_search_comm_dt_attr_cb(const H5A_t *attr, void *_udata) +{ + H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; + H5T_t *dt = NULL; /* Datatype */ + H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ + haddr_t *addr = NULL; /* Destination address */ + hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(attr); + HDassert(udata); + HDassert(udata->dst_dt_list); + HDassert(H5F_addr_defined(udata->obj_oloc.addr)); + + /* Get attribute datatype */ + if(NULL == (dt = H5A_type(attr))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't get attribute datatype") + + /* Check if the datatype is committed and search the skip list if so */ + if(H5T_committed(dt)) { + /* Allocate key */ + if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Copy datatype into key */ + if(NULL == (key->dt = (H5T_t *)H5O_msg_copy(H5O_DTYPE_ID, dt, NULL))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy datatype message") + + /* Get datatype object fileno */ + H5F_GET_FILENO(udata->obj_oloc.file, key->fileno); + + if(!H5SL_search(udata->dst_dt_list, key)) { + /* Allocate destination address */ + if(NULL == (addr = H5FL_MALLOC(haddr_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Add the destination datatype to the skip list */ + *addr = ((H5O_shared_t *)(key->dt))->u.loc.oh_addr; + if(H5SL_insert(udata->dst_dt_list, addr, key) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + obj_inserted = TRUE; + } /* end if */ + } /* end if */ + +done: + /* Release resources */ + if(!obj_inserted) { + if(key) { + if(key->dt) + key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt); + key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key); + } /* end if */ + if(addr) { + HDassert(ret_value < 0); + addr = H5FL_FREE(haddr_t, addr); + } /* end if */ + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_search_comm_dt_attr_cb */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_search_comm_dt_check + * + * Purpose: Check if the object at obj_oloc is or contains a reference + * to a committed datatype. If it does, adds it to the merge + * committed dt skiplist present in udata if it does not match + * any already present. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * Nov 3 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_copy_search_comm_dt_check(H5O_loc_t *obj_oloc, + H5O_copy_search_comm_dt_ud_t *udata) +{ + H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ + haddr_t *addr = NULL; /* Destination address */ + hbool_t obj_inserted = FALSE; /* Object inserted into skip list */ + H5O_info_t oinfo; /* Object info */ + H5A_attr_iter_op_t attr_op; /* Attribute iteration operator */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(obj_oloc); + HDassert(udata); + HDassert(udata->dst_dt_list); + HDassert(udata->dst_root_loc); + + /* Get the object's info */ + if(H5O_get_info(obj_oloc, udata->dxpl_id, TRUE, &oinfo) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get object info") + + /* Check if the object is a datatype, a dataset using a committed + * datatype, or contains an attribute using a committed datatype */ + if(oinfo.type == H5O_TYPE_NAMED_DATATYPE) { + /* Allocate key */ + if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Read the destination datatype */ + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") + + /* Get destination object fileno */ + H5F_GET_FILENO(obj_oloc->file, key->fileno); + + /* Check if the datatype is already present in the skip list */ + if(!H5SL_search(udata->dst_dt_list, key)) { + /* Allocate destination address */ + if(NULL == (addr = H5FL_MALLOC(haddr_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Add the destination datatype to the skip list */ + *addr = obj_oloc->addr; + if(H5SL_insert(udata->dst_dt_list, addr, key) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + obj_inserted = TRUE; + } /* end if */ + } /* end if */ + else if(oinfo.type == H5O_TYPE_DATASET) { + /* Allocate key */ + if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Read the destination datatype */ + if(NULL == (key->dt = (H5T_t *)H5O_msg_read(obj_oloc, H5O_DTYPE_ID, NULL, udata->dxpl_id))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") + + /* Check if the datatype is committed and search the skip list if so + */ + if(H5T_committed(key->dt)) { + /* Get datatype object fileno */ + H5F_GET_FILENO(obj_oloc->file, key->fileno); + + if(!H5SL_search(udata->dst_dt_list, key)) { + /* Allocate destination address */ + if(NULL == (addr = H5FL_MALLOC(haddr_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Add the destination datatype to the skip list */ + *addr = ((H5O_shared_t *)(key->dt))->u.loc.oh_addr; + if(H5SL_insert(udata->dst_dt_list, addr, key) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + obj_inserted = TRUE; + } /* end if */ + } /* end if */ + } /* end else */ + + /* Search within attributes */ + attr_op.op_type = H5A_ATTR_OP_LIB; + attr_op.u.lib_op = H5O_copy_search_comm_dt_attr_cb; + udata->obj_oloc.file = obj_oloc->file; + udata->obj_oloc.addr = obj_oloc->addr; + if(H5O_attr_iterate_real((hid_t)-1, obj_oloc, udata->dxpl_id, H5_INDEX_NAME, H5_ITER_NATIVE, 0, NULL, &attr_op, udata) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "error iterating over attributes"); + +done: + /* Release resources */ + if(!obj_inserted) { + if(key) { + if(key->dt) + key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt); + key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key); + } /* end if */ + if(addr) { + HDassert(ret_value < 0); + addr = H5FL_FREE(haddr_t, addr); + } /* end if */ + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_search_comm_dt_check */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_search_comm_dt_cb + * + * Purpose: H5G_visit callback to add committed datatypes to the merge + * committed dt skiplist. Mostly a wrapper for + * H5O_copy_search_comm_dt_check. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * Oct 6 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_copy_search_comm_dt_cb(hid_t UNUSED group, const char *name, + const H5L_info_t *linfo, void *_udata) +{ + H5O_copy_search_comm_dt_ud_t *udata = (H5O_copy_search_comm_dt_ud_t *)_udata; /* Skip list of dtypes in dest file */ + H5G_loc_t obj_loc; /* Location of object */ + H5O_loc_t obj_oloc; /* Object's object location */ + H5G_name_t obj_path; /* Object's group hier. path */ + hbool_t obj_found = FALSE; /* Object at 'name' found */ + herr_t ret_value = H5_ITER_CONT; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(name); + HDassert(linfo); + HDassert(udata); + HDassert(udata->dst_dt_list); + HDassert(udata->dst_root_loc); + + /* Check if this is a hard link */ + if(linfo->type == H5L_TYPE_HARD) { + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Find the object */ + if(H5G_loc_find(udata->dst_root_loc, name, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, udata->dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, H5_ITER_ERROR, "object not found") + obj_found = TRUE; + + /* Check object and add to skip list if appropriate */ + if(H5O_copy_search_comm_dt_check(&obj_oloc, udata) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, H5_ITER_ERROR, "can't check object") + } /* end if */ + +done: + /* Release resources */ + if(obj_found && H5G_loc_free(&obj_loc) < 0) + HDONE_ERROR(H5E_OHDR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't free location") + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_search_comm_dt_cb */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_search_comm_dt + * + * Purpose: Checks if the committed datatype present in oh_src matches any + * in the destination file, building the destination file + * skiplist as necessary. + * + * Return: TRUE if a match is found in the destination file + * - oloc_dst will contain the address + * FALSE if a match is not found + * Negative on failure + * + * Programmer: Neil Fortner + * Sep 27 2011 + * + *------------------------------------------------------------------------- + */ +static htri_t +H5O_copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, + H5O_loc_t *oloc_dst/*in, out*/, hid_t dxpl_id, H5O_copy_t *cpy_info) +{ + H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ + haddr_t *dst_addr; /* Destination datatype address */ + H5G_loc_t dst_root_loc = {NULL, NULL}; /* Destination root group location */ + H5O_copy_search_comm_dt_ud_t udata; /* Group iteration user data */ + herr_t ret_value = FALSE; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(oh_src); + HDassert(oloc_dst); + HDassert(oloc_dst->file); + HDassert(H5F_FILE_ID(oloc_dst->file) >= 0); + HDassert(cpy_info); + + /* Allocate key */ + if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Read the source datatype */ + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") + + /* Get destination object fileno */ + H5F_GET_FILENO(oloc_dst->file, key->fileno); + + /* Check if the destination dtype list exists, create it if it does not */ + if(!cpy_info->dst_dt_list) { + /* Create the skip list */ + if(NULL == (cpy_info->dst_dt_list = H5SL_create(H5SL_TYPE_GENERIC, H5O_copy_comm_dt_cmp))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "can't create skip list for committed datatypes") + + /* Add suggested types to list, if they are present */ + if(cpy_info->dst_dt_suggestion_list) { + H5O_copy_dtype_merge_list_t *suggestion = cpy_info->dst_dt_suggestion_list; + H5G_loc_t obj_loc; /* Location of object */ + H5O_loc_t obj_oloc; /* Object's object location */ + H5G_name_t obj_path; /* Object's group hier. path */ + + /* Set up the root group in the destination file */ + if(NULL == (dst_root_loc.oloc = H5G_oloc(H5G_rootof(oloc_dst->file)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location for root group") + if(NULL == (dst_root_loc.path = H5G_nameof(H5G_rootof(oloc_dst->file)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path for root group") + + /* Set up opened group location to fill in */ + obj_loc.oloc = &obj_oloc; + obj_loc.path = &obj_path; + H5G_loc_reset(&obj_loc); + + /* Build udata */ + udata.dst_dt_list = cpy_info->dst_dt_list; + udata.dst_root_loc = &dst_root_loc; + udata.obj_oloc.file = NULL; + udata.obj_oloc.addr = HADDR_UNDEF; + udata.dxpl_id = dxpl_id; + + /* Walk through the list of datatype suggestions */ + while(suggestion) { + /* Find the object */ + if(H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc/*out*/, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + /* Ignore errors - i.e. suggestions not present in + * destination file */ + H5E_clear_stack(NULL); + else + /* Check object and add to skip list if appropriate */ + if(H5O_copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { + if(H5G_loc_free(&obj_loc) < 0) + HERROR(H5E_OHDR, H5E_CANTRELEASE, "can't free location"); + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't check object") + } /* end if */ + + /* Free location */ + if(H5G_loc_free(&obj_loc) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location"); + + /* Advance the suggestion pointer */ + suggestion = suggestion->next; + } /* end while */ + } /* end if */ + } + + if(!cpy_info->dst_dt_list_complete) { + /* Search for the type in the destination file, and return its address + * if found, but only if the list is populated with and only with + * suggested types. We will search complete lists later. */ + if(cpy_info->dst_dt_suggestion_list + && NULL != (dst_addr = (haddr_t *)H5SL_search( + cpy_info->dst_dt_list, key))) { + oloc_dst->addr = *dst_addr; + ret_value = TRUE; + } /* end if */ + else { + H5O_mcdt_search_ret_t search_cb_ret = H5O_MCDT_SEARCH_CONT; + + /* Make callback to see if we should search destination file */ + if(cpy_info->mcdt_cb) + if((search_cb_ret = cpy_info->mcdt_cb(cpy_info->mcdt_ud)) == H5O_MCDT_SEARCH_ERROR) + HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "callback returned error") + + if(search_cb_ret == H5O_MCDT_SEARCH_CONT) { + /* Build the complete dst dt list */ + /* Set up the root group in the destination file, if necessary */ + if(!dst_root_loc.oloc) { + HDassert(!dst_root_loc.path); + if(NULL == (dst_root_loc.oloc = H5G_oloc(H5G_rootof(oloc_dst->file)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get object location for root group") + if(NULL == (dst_root_loc.path = H5G_nameof(H5G_rootof(oloc_dst->file)))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get path for root group") + } /* end if */ + else + HDassert(dst_root_loc.path); + + /* Build udata. Note that this may be done twice in some cases, but + * it should be rare and should be cheaper on average than trying to + * keep track of whether it was done before. */ + udata.dst_dt_list = cpy_info->dst_dt_list; + udata.dst_root_loc = &dst_root_loc; + udata.obj_oloc.file = NULL; + udata.obj_oloc.addr = HADDR_UNDEF; + udata.dxpl_id = dxpl_id; + + /* Traverse the destination file, adding committed datatypes to the skip + * list */ + if(H5G_visit(H5F_FILE_ID(oloc_dst->file), "/", H5_INDEX_NAME, H5_ITER_NATIVE, H5O_copy_search_comm_dt_cb, &udata, H5P_LINK_ACCESS_DEFAULT, dxpl_id) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_BADITER, FAIL, "object visitation failed") + cpy_info->dst_dt_list_complete = TRUE; + } /* end if */ + else + if(search_cb_ret != H5O_MCDT_SEARCH_STOP) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unknown return value for callback") + } /* end if */ + } /* end if */ + + /* Search for the type in the destination file, and return its address if + * found, but only if the list is complete */ + if(cpy_info->dst_dt_list_complete) { + if(NULL != (dst_addr = (haddr_t *)H5SL_search(cpy_info->dst_dt_list, key))) { + oloc_dst->addr = *dst_addr; + ret_value = TRUE; + } /* end if */ + } /* end if */ + +done: + if(key) { + if(key->dt) + key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt); + key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_search_comm_dt */ + + +/*------------------------------------------------------------------------- + * Function: H5O_copy_insert_comm_dt + * + * Purpose: Insert the committed datatype at oloc_dst into the merge committed + * dt skiplist. The datatype must not be present already. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * Oct 6 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_copy_insert_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst, + hid_t dxpl_id, H5O_copy_t *cpy_info) +{ + H5O_copy_search_comm_dt_key_t *key = NULL; /* Skiplist key */ + haddr_t *addr = NULL; /* Destination object address */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity checks */ + HDassert(oh_src); + HDassert(oloc_dst); + HDassert(oloc_dst->file); + HDassert(oloc_dst->addr != HADDR_UNDEF); + HDassert(cpy_info); + HDassert(cpy_info->dst_dt_list); + + /* Allocate key */ + if(NULL == (key = H5FL_MALLOC(H5O_copy_search_comm_dt_key_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Read the datatype. Read from the source file because the destination + * object could be changed in the post-copy. */ + if(NULL == (key->dt = (H5T_t *)H5O_msg_read_oh(file_src, dxpl_id, oh_src, H5O_DTYPE_ID, NULL))) + HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't read DTYPE message") + + /* Get destination object fileno */ + H5F_GET_FILENO(oloc_dst->file, key->fileno); + + /* Allocate destination address */ + if(NULL == (addr = H5FL_MALLOC(haddr_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Add the destination datatype to the skip list */ + *addr = oloc_dst->addr; + if(H5SL_insert(cpy_info->dst_dt_list, addr, key) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINSERT, FAIL, "can't insert object into skip list") + +done: + if(ret_value < 0) { + if(key) { + if(key->dt) + key->dt = (H5T_t *)H5O_msg_free(H5O_DTYPE_ID, key->dt); + key = H5FL_FREE(H5O_copy_search_comm_dt_key_t, key); + } /* end if */ + if(addr) + addr = H5FL_FREE(haddr_t, addr); + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5O_copy_insert_comm_dt */ + diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 9ccb51b..1b602c7 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -43,6 +43,9 @@ static herr_t H5O_dtype_pre_copy_file(H5F_t *file_src, const void *mesg_src, static void *H5O_dtype_copy_file(H5F_t *file_src, const H5O_msg_class_t *mesg_type, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); +static herr_t H5O_dtype_shared_post_copy_upd(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, + H5O_copy_t *cpy_info); static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -63,6 +66,7 @@ static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_SHARED_COPY_FILE_REAL H5O_dtype_copy_file #define H5O_SHARED_POST_COPY_FILE H5O_dtype_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL +#define H5O_SHARED_POST_COPY_FILE_UPD H5O_dtype_shared_post_copy_upd #define H5O_SHARED_DEBUG H5O_dtype_shared_debug #define H5O_SHARED_DEBUG_REAL H5O_dtype_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -1575,6 +1579,40 @@ done: } /* end H5O_dtype_copy_file() */ +/*------------------------------------------------------------------------- + * Function: H5O_dtype_shared_post_copy_upd + * + * Purpose: Update a message after the shared message operations + * during the post-copy loop + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * November 8, 2011 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5O_dtype_shared_post_copy_upd(const H5O_loc_t UNUSED *src_oloc, + const void UNUSED *mesg_src, H5O_loc_t UNUSED *dst_oloc, void *mesg_dst, + hid_t UNUSED dxpl_id, H5O_copy_t UNUSED *cpy_info) +{ + H5T_t *dt_dst = (H5T_t *)mesg_dst; /* Destination datatype */ + + FUNC_ENTER_NOAPI_NOINIT + + if(dt_dst->sh_loc.type == H5O_SHARE_TYPE_COMMITTED) { + HDassert(H5T_committed(dt_dst)); + dt_dst->oloc.file = dt_dst->sh_loc.file; + dt_dst->oloc.addr = dt_dst->sh_loc.u.loc.oh_addr; + } /* end if */ + else + HDassert(!H5T_committed(dt_dst)); + + FUNC_LEAVE_NOAPI(SUCCEED) +} /* end H5O_dtype_shared_post_copy_upd */ + + /*-------------------------------------------------------------------------- NAME H5O_dtype_debug diff --git a/src/H5Oefl.c b/src/H5Oefl.c index e4b21f0..3630cf4 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -36,8 +36,8 @@ static void *H5O_efl_copy(const void *_mesg, void *_dest); static size_t H5O_efl_size(const H5F_t *f, hbool_t disable_shared, const void *_mesg); static herr_t H5O_efl_reset(void *_mesg); static void *H5O_efl_copy_file(H5F_t *file_src, void *mesg_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); static herr_t H5O_efl_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -455,8 +455,8 @@ done: */ static void * H5O_efl_copy_file(H5F_t UNUSED *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t UNUSED *cpy_info, - void UNUSED *_udata, hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t UNUSED *cpy_info, void UNUSED *_udata, hid_t dxpl_id) { H5O_efl_t *efl_src = (H5O_efl_t *) mesg_src; H5O_efl_t *efl_dst = NULL; diff --git a/src/H5Ofill.c b/src/H5Ofill.c index 9fa6108..f5569dc 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -63,6 +63,7 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_fill_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL +#undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_fill_shared_debug #define H5O_SHARED_DEBUG_REAL H5O_fill_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ @@ -95,6 +96,7 @@ static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *s #undef H5O_SHARED_POST_COPY_FILE #define H5O_SHARED_POST_COPY_FILE H5O_fill_new_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL +#undef H5O_SHARED_POST_COPY_FILE_UPD #undef H5O_SHARED_DEBUG #define H5O_SHARED_DEBUG H5O_fill_new_shared_debug #undef H5O_SHARED_DEBUG_REAL diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 1b17bff..e912d8c 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -46,8 +46,8 @@ static herr_t H5O_layout_free(void *_mesg); static herr_t H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); static void *H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); static herr_t H5O_layout_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -587,8 +587,8 @@ done: */ static void * H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void *_udata, - hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; /* Dataset copying user data */ H5O_layout_t *layout_src = (H5O_layout_t *) mesg_src; diff --git a/src/H5Olinfo.c b/src/H5Olinfo.c index acdd1e1..e96483a 100644 --- a/src/H5Olinfo.c +++ b/src/H5Olinfo.c @@ -46,10 +46,11 @@ static herr_t H5O_linfo_free(void *_mesg); static herr_t H5O_linfo_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); static void *H5O_linfo_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, - void *udata, hid_t dxpl_id); -static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, - void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); +static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *parent_src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); static herr_t H5O_linfo_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -379,8 +380,8 @@ done: */ static void * H5O_linfo_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void *_udata, - hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id) { H5O_linfo_t *linfo_src = (H5O_linfo_t *) native_src; H5O_linfo_t *linfo_dst = NULL; @@ -501,7 +502,8 @@ done: */ static herr_t H5O_linfo_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_linfo_t *linfo_src = (const H5O_linfo_t *)mesg_src; H5O_linfo_t *linfo_dst = (H5O_linfo_t *)mesg_dst; diff --git a/src/H5Olink.c b/src/H5Olink.c index ccc6d0e..88c9e28 100644 --- a/src/H5Olink.c +++ b/src/H5Olink.c @@ -49,10 +49,11 @@ static herr_t H5O_link_free(void *_mesg); static herr_t H5O_link_pre_copy_file(H5F_t *file_src, const void *mesg_src, hbool_t *deleted, const H5O_copy_t *cpy_info, void *udata); static void *H5O_link_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, - hid_t dxpl_id); -static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, - void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); +static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); static herr_t H5O_link_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -710,8 +711,8 @@ H5O_link_pre_copy_file(H5F_t UNUSED *file_src, const void UNUSED *native_src, */ static void * H5O_link_copy_file(H5F_t UNUSED *file_src, void *native_src, H5F_t UNUSED *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t UNUSED *cpy_info, void UNUSED *udata, - hid_t UNUSED dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t UNUSED *cpy_info, void UNUSED *udata, hid_t UNUSED dxpl_id) { H5O_link_t *link_src = (H5O_link_t *)native_src; void *ret_value; /* Return value */ @@ -751,7 +752,8 @@ done: */ static herr_t H5O_link_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, - H5O_loc_t *dst_oloc, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_link_t *link_src = (const H5O_link_t *)mesg_src; H5O_link_t *link_dst = (H5O_link_t *)mesg_dst; diff --git a/src/H5Omessage.c b/src/H5Omessage.c index f12c835..c9a0997 100644 --- a/src/H5Omessage.c +++ b/src/H5Omessage.c @@ -1855,7 +1855,7 @@ done: void * H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *native_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) { void *ret_value; @@ -1873,7 +1873,7 @@ H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, /* The copy_file callback will return an H5O_shared_t only if the message * to be copied is a committed datatype. */ - if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, cpy_info, udata, dxpl_id))) + if(NULL == (ret_value = (type->copy_file)(file_src, native_src, file_dst, recompute_size, mesg_flags, cpy_info, udata, dxpl_id))) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object header message to file") done: @@ -1986,7 +1986,7 @@ H5O_copy_mesg(H5F_t *f, hid_t dxpl_id, H5O_t *oh, unsigned idx, HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to copy message to object header") /* Update the message flags */ - idx_msg->flags = mesg_flags; + idx_msg->flags = (uint8_t)mesg_flags; /* Mark the message as modified */ idx_msg->dirty = TRUE; diff --git a/src/H5Opkg.h b/src/H5Opkg.h index d4df79b..d4cc3fb 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -234,8 +234,8 @@ struct H5O_msg_class_t { herr_t (*set_share)(void*, const H5O_shared_t*); /* Set shared information */ htri_t (*can_share)(const void *); /* Is message allowed to be shared? */ herr_t (*pre_copy_file)(H5F_t *, const void *, hbool_t *, const H5O_copy_t *, void *); /*"pre copy" action when copying native value to file */ - void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, H5O_copy_t *, void *, hid_t); /*copy native value to file */ - herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */ + void *(*copy_file)(H5F_t *, void *, H5F_t *, hbool_t *, unsigned *, H5O_copy_t *, void *, hid_t); /*copy native value to file */ + herr_t (*post_copy_file)(const H5O_loc_t *, const void *, H5O_loc_t *, void *, unsigned *, hid_t, H5O_copy_t *); /*"post copy" action when copying native value to file */ herr_t (*get_crt_index)(const void *, H5O_msg_crt_idx_t *); /* Get message's creation index */ herr_t (*set_crt_index)(void *, H5O_msg_crt_idx_t); /* Set message's creation index */ herr_t (*debug)(H5F_t*, hid_t, const void*, FILE*, int, int); @@ -550,7 +550,7 @@ H5_DLL herr_t H5O_msg_remove_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *ty int sequence, H5O_operator_t op, void *op_data, hbool_t adj_link, hid_t dxpl_id); H5_DLL void *H5O_msg_copy_file(const H5O_msg_class_t *type, H5F_t *file_src, void *mesg_src, H5F_t *file_dst, hbool_t *recompute_size, - H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); + unsigned *mesg_flags, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); H5_DLL herr_t H5O_msg_iterate_real(H5F_t *f, H5O_t *oh, const H5O_msg_class_t *type, const H5O_mesg_operator_t *op, void *op_data, hid_t dxpl_id); @@ -587,10 +587,12 @@ H5_DLL herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, const H5O_msg_class_t *mesg_type, H5O_shared_t *sh_mesg); H5_DLL herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, - hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id); + hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + void *udata, hid_t dxpl_id); H5_DLL herr_t H5O_shared_post_copy_file (H5F_t *f, const H5O_msg_class_t *mesg_type, const H5O_shared_t *shared_src, - H5O_shared_t *shared_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); + H5O_shared_t *shared_dst, unsigned *mesg_flags, hid_t dxpl_id, + H5O_copy_t *cpy_info); H5_DLL herr_t H5O_shared_debug(const H5O_shared_t *mesg, FILE *stream, int indent, int fwidth); diff --git a/src/H5Opline.c b/src/H5Opline.c index 89ce865..f626106 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -61,6 +61,7 @@ static herr_t H5O_pline_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_pline_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL +#undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_pline_shared_debug #define H5O_SHARED_DEBUG_REAL H5O_pline_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index 97bd9a7..8e2dfa4 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -99,7 +99,9 @@ typedef struct H5O_t H5O_t; #endif /* H5O_ENABLE_BAD_MESG_COUNT */ /* ========= Object Copy properties ============ */ -#define H5O_CPY_OPTION_NAME "copy object" /* Copy options */ +#define H5O_CPY_OPTION_NAME "copy object" /* Copy options */ +#define H5O_CPY_MERGE_COMM_DT_LIST_NAME "merge committed dtype list" /* List of datatype paths to search in the dest file for merging */ +#define H5O_CPY_MCDT_SEARCH_CB_NAME "committed dtype list search" /* Callback function when the search for a matching committed datatype is complete */ /* If the module using this macro is allowed access to the private variables, access them directly */ #ifdef H5O_PACKAGE @@ -133,6 +135,18 @@ typedef struct H5O_loc_t { * its file's count of open objects. */ } H5O_loc_t; +/* Typedef for linked list of datatype merge suggestions */ +typedef struct H5O_copy_dtype_merge_list_t { + char *path; /* Path to datatype in destination file */ + struct H5O_copy_dtype_merge_list_t *next; /* Next object in list */ +} H5O_copy_dtype_merge_list_t; + +/* Structure for callback property before searching the global list of committed datatypes at destination */ +typedef struct H5O_mcdt_cb_info_t { + H5O_mcdt_search_cb_t func; + void *user_data; +} H5O_mcdt_cb_info_t; + /* Settings/flags for copying an object */ typedef struct H5O_copy_t { hbool_t copy_shallow; /* Flag to perform shallow hierarchy copy */ @@ -141,10 +155,16 @@ typedef struct H5O_copy_t { hbool_t expand_ref; /* Flag to expand object references */ hbool_t copy_without_attr; /* Flag to not copy attributes */ hbool_t preserve_null; /* Flag to not delete NULL messages */ + hbool_t merge_comm_dt; /* Flag to merge committed datatypes in dest file */ + H5O_copy_dtype_merge_list_t *dst_dt_suggestion_list; /* Suggestions for merging committed datatypes */ int curr_depth; /* Current depth in hierarchy copied */ int max_depth; /* Maximum depth in hierarchy to copy */ H5SL_t *map_list; /* Skip list to hold address mappings */ + H5SL_t *dst_dt_list; /* Skip list to hold committed datatypes in dest file */ + hbool_t dst_dt_list_complete; /* Whether the destination datatype list is complete (i.e. not only populated with "suggestions" from H5Padd_merge_committed_dtype_path) */ H5O_t *oh_dst; /* The destination object header */ + H5O_mcdt_search_cb_t mcdt_cb; /* The callback to invoke before searching the global list of committed datatypes at destination */ + void *mcdt_ud; /* User data passed to callback */ } H5O_copy_t; /* Header message IDs */ diff --git a/src/H5Opublic.h b/src/H5Opublic.h index 2379d6b..a7d386a 100644 --- a/src/H5Opublic.h +++ b/src/H5Opublic.h @@ -43,7 +43,8 @@ #define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */ #define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /* Copy object without copying attributes */ #define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /* Copy NULL messages (empty space) */ -#define H5O_COPY_ALL (0x003Fu) /* All object copying flags (for internal checking) */ +#define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /* Merge committed datatypes in dest file */ +#define H5O_COPY_ALL (0x007Fu) /* All object copying flags (for internal checking) */ /* Flags for shared message indexes. * Pass these flags in using the mesg_type_flags parameter in @@ -131,6 +132,14 @@ typedef uint32_t H5O_msg_crt_idx_t; typedef herr_t (*H5O_iterate_t)(hid_t obj, const char *name, const H5O_info_t *info, void *op_data); +typedef enum H5O_mcdt_search_ret_t { + H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */ + H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */ + H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */ +} H5O_mcdt_search_ret_t; + +/* Callback to invoke when completing the search for a matching committed datatype from the committed dtype list */ +typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data); /********************/ /* Public Variables */ diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 8ae73f7..905c4e9 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -55,6 +55,7 @@ static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #undef H5O_SHARED_COPY_FILE_REAL #define H5O_SHARED_POST_COPY_FILE H5O_sdspace_shared_post_copy_file #undef H5O_SHARED_POST_COPY_FILE_REAL +#undef H5O_SHARED_POST_COPY_FILE_UPD #define H5O_SHARED_DEBUG H5O_sdspace_shared_debug #define H5O_SHARED_DEBUG_REAL H5O_sdspace_debug #include "H5Oshared.h" /* Shared Object Header Message Callbacks */ diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 4cc30e8..c29e2c7 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -589,8 +589,8 @@ done: herr_t H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, const H5O_msg_class_t *mesg_type, const void *_native_src, void *_native_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t *cpy_info, void UNUSED *udata, - hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + void UNUSED *udata, hid_t dxpl_id) { const H5O_shared_t *shared_src = (const H5O_shared_t *)_native_src; /* Alias to shared info in native source */ H5O_shared_t *shared_dst = (H5O_shared_t *)_native_dst; /* Alias to shared info in native destination message */ @@ -621,16 +621,18 @@ H5O_shared_copy_file(H5F_t *file_src, H5F_t *file_dst, /* Set copied metadata tag */ H5_BEGIN_TAG(dxpl_id, H5AC__COPIED_TAG, FAIL); - if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, mesg_type->id, _native_dst, NULL) < 0) + if(H5SM_try_share(file_dst, dxpl_id, NULL, H5SM_DEFER, mesg_type->id, _native_dst, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to determine if message should be shared") /* Reset metadata tag */ H5_END_TAG(FAIL); } /* end if */ - else + else { /* Mark the message as committed - as it will be committed in post copy */ H5O_UPDATE_SHARED(shared_dst, H5O_SHARE_TYPE_COMMITTED, file_dst, mesg_type->id, 0, HADDR_UNDEF) + *mesg_flags |= H5O_MSG_FLAG_SHARED; + } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) @@ -657,8 +659,8 @@ done: */ herr_t H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, - const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, hid_t dxpl_id, - H5O_copy_t *cpy_info) + const H5O_shared_t *shared_src, H5O_shared_t *shared_dst, + unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info) { herr_t ret_value = SUCCEED; /* Return value */ @@ -675,6 +677,7 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, H5O_loc_t src_oloc; /* Copy the shared object from source to destination */ + H5O_loc_reset(&dst_oloc); dst_oloc.file = f; src_oloc.file = shared_src->file; src_oloc.addr = shared_src->u.loc.oh_addr; @@ -688,7 +691,7 @@ H5O_shared_post_copy_file(H5F_t *f, const H5O_msg_class_t *mesg_type, else /* Share the message */ if(H5SM_try_share(f, dxpl_id, NULL, H5SM_WAS_DEFERRED, mesg_type->id, - shared_dst, NULL) < 0) + shared_dst, mesg_flags) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "can't share message") done: diff --git a/src/H5Oshared.h b/src/H5Oshared.h index ddacc25..3ec5709 100644 --- a/src/H5Oshared.h +++ b/src/H5Oshared.h @@ -320,7 +320,8 @@ done: */ static H5_inline void * H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, - hbool_t *recompute_size, H5O_copy_t *cpy_info, void *udata, hid_t dxpl_id) + hbool_t *recompute_size, unsigned *mesg_flags, H5O_copy_t *cpy_info, + void *udata, hid_t dxpl_id) { void *dst_mesg = NULL; /* Destination message */ void *ret_value; /* Return value */ @@ -348,8 +349,8 @@ H5O_SHARED_COPY_FILE(H5F_t *file_src, void *_native_src, H5F_t *file_dst, HDmemset(dst_mesg, 0, sizeof(H5O_shared_t)); /* Handle sharing destination message */ - if(H5O_shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, - _native_src, dst_mesg, recompute_size, cpy_info, udata, dxpl_id) < 0) + if(H5O_shared_copy_file(file_src, file_dst, H5O_SHARED_TYPE, _native_src, + dst_mesg, recompute_size, mesg_flags, cpy_info, udata, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, NULL, "unable to determine if message should be shared") /* Set return value */ @@ -383,7 +384,8 @@ done: */ static H5_inline herr_t H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, - H5O_loc_t *oloc_dst, void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) + H5O_loc_t *oloc_dst, void *mesg_dst, unsigned *mesg_flags, hid_t dxpl_id, + H5O_copy_t *cpy_info) { const H5O_shared_t *shared_src = (const H5O_shared_t *)mesg_src; /* Alias to shared info in native source */ H5O_shared_t *shared_dst = (H5O_shared_t *)mesg_dst; /* Alias to shared info in native destination */ @@ -405,7 +407,7 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, #endif /* H5O_SHARED_POST_COPY_FILE */ #ifdef H5O_SHARED_POST_COPY_FILE_REAL - /* Call native message's copy file callback to copy the message */ + /* Call native message's post copy file callback to copy the message */ if(H5O_SHARED_POST_COPY_FILE_REAL(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) <0 ) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to copy native message to another file") #endif /* H5O_SHARED_POST_COPY_FILE_REAL */ @@ -414,9 +416,16 @@ H5O_SHARED_POST_COPY_FILE(const H5O_loc_t *oloc_src, const void *mesg_src, * production if the DEFER pass determined it will not be shared; debug mode * verifies that it is indeed the case */ if(H5O_shared_post_copy_file(oloc_dst->file, H5O_SHARED_TYPE, - shared_src, shared_dst, dxpl_id, cpy_info) < 0) + shared_src, shared_dst, mesg_flags, dxpl_id, cpy_info) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to fix shared message in post copy") +#ifdef H5O_SHARED_POST_COPY_FILE_UPD + /* Call native message's post copy file update callback to update the + * message */ + if(H5O_SHARED_POST_COPY_FILE_UPD(oloc_src, mesg_src, oloc_dst, mesg_dst, dxpl_id, cpy_info) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, FAIL, "unable to update native message") +#endif /* H5O_SHARED_POST_COPY_FILE_UPD */ + /* Make sure that if the the source or destination is committed, both are * committed */ HDassert((shared_src->type == H5O_SHARE_TYPE_COMMITTED) diff --git a/src/H5Ostab.c b/src/H5Ostab.c index 42cd92c..d5f5f86 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -44,10 +44,11 @@ static size_t H5O_stab_size(const H5F_t *f, hbool_t disable_shared, const void * static herr_t H5O_stab_free(void *_mesg); static herr_t H5O_stab_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg); static void *H5O_stab_copy_file(H5F_t *file_src, void *native_src, - H5F_t *file_dst, hbool_t *recompute_size, H5O_copy_t *cpy_info, void *_udata, - hid_t dxpl_id); -static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, - void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info); + H5F_t *file_dst, hbool_t *recompute_size, unsigned *mesg_flags, + H5O_copy_t *cpy_info, void *_udata, hid_t dxpl_id); +static herr_t H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, + const void *mesg_src, H5O_loc_t *dst_oloc, void *mesg_dst, + unsigned *mesg_flags, hid_t dxpl_id, H5O_copy_t *cpy_info); static herr_t H5O_stab_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int indent, int fwidth); @@ -307,8 +308,8 @@ done: */ static void * H5O_stab_copy_file(H5F_t *file_src, void *native_src, H5F_t *file_dst, - hbool_t UNUSED *recompute_size, H5O_copy_t UNUSED *cpy_info, void *_udata, - hid_t dxpl_id) + hbool_t UNUSED *recompute_size, unsigned UNUSED *mesg_flags, + H5O_copy_t UNUSED *cpy_info, void *_udata, hid_t dxpl_id) { H5O_stab_t *stab_src = (H5O_stab_t *) native_src; H5O_stab_t *stab_dst = NULL; @@ -370,8 +371,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, H5O_loc_t *dst_oloc, - void *mesg_dst, hid_t dxpl_id, H5O_copy_t *cpy_info) +H5O_stab_post_copy_file(const H5O_loc_t *src_oloc, const void *mesg_src, + H5O_loc_t *dst_oloc, void *mesg_dst, unsigned UNUSED *mesg_flags, + hid_t dxpl_id, H5O_copy_t *cpy_info) { const H5O_stab_t *stab_src = (const H5O_stab_t *)mesg_src; H5O_stab_t *stab_dst = (H5O_stab_t *)mesg_dst; diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 6a3067d..32793e6 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -392,7 +392,7 @@ H5P_dcrt_layout_cmp(const void *_layout1, const void *_layout2, size_t UNUSED si /* Sanity check */ HDassert(layout1); - HDassert(layout1); + HDassert(layout2); HDassert(size == sizeof(H5O_layout_t)); /* Check for different layout type */ diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index af50d80..e61a0d7 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -35,7 +35,9 @@ /***********/ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ +#include "H5FLprivate.h" /* Free Lists */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Ppkg.h" /* Property lists */ @@ -47,7 +49,13 @@ /* Definitions for copy options */ #define H5O_CPY_OPTION_SIZE sizeof(unsigned) #define H5O_CPY_OPTION_DEF 0 - +/* Definitions for merge committed dtype list */ +#define H5O_CPY_MERGE_COMM_DT_LIST_SIZE sizeof(char *) +#define H5O_CPY_MERGE_COMM_DT_LIST_DEF NULL +#define H5O_CPY_MERGE_COMM_DT_LIST_CMP H5P_ocpy_merge_comm_dt_list_cmp +/* Definitions for callback function when completing the search for a matching committed datatype from the committed dtype list */ +#define H5O_CPY_MCDT_SEARCH_CB_SIZE sizeof(H5O_mcdt_cb_info_t) +#define H5O_CPY_MCDT_SEARCH_CB_DEF {NULL,NULL} /******************/ /* Local Typedefs */ @@ -63,8 +71,17 @@ /* Local Prototypes */ /********************/ +/* General routines */ +static H5O_copy_dtype_merge_list_t *H5P_free_merge_comm_dtype_list(H5O_copy_dtype_merge_list_t *dt_list); + /* Property class callbacks */ static herr_t H5P_ocpy_reg_prop(H5P_genclass_t *pclass); +static herr_t H5P_ocpy_copy(hid_t dst_plist_id, hid_t src_plist_id, + void *copy_data); +static herr_t H5P_ocpy_close(hid_t ocpypl_id, void *close_data); + +/* Property callbacks */ +static int H5P_ocpy_merge_comm_dt_list_cmp(const void *value1, const void *value2, size_t size); /*********************/ @@ -80,9 +97,9 @@ const H5P_libclass_t H5P_CLS_OCPY[1] = {{ H5P_ocpy_reg_prop, /* Default property registration routine */ NULL, /* Class creation callback */ NULL, /* Class creation callback info */ - NULL, /* Class copy callback */ + H5P_ocpy_copy, /* Class copy callback */ NULL, /* Class copy callback info */ - NULL, /* Class close callback */ + H5P_ocpy_close, /* Class close callback */ NULL /* Class close callback info */ }}; @@ -96,6 +113,9 @@ const H5P_libclass_t H5P_CLS_OCPY[1] = {{ /* Local Variables */ /*******************/ +/* Declare a free list to manage the H5O_copy_dtype_merge_list_t struct */ +H5FL_DEFINE(H5O_copy_dtype_merge_list_t); + /*------------------------------------------------------------------------- @@ -109,10 +129,12 @@ const H5P_libclass_t H5P_CLS_OCPY[1] = {{ * October 31, 2006 *------------------------------------------------------------------------- */ -herr_t +static herr_t H5P_ocpy_reg_prop(H5P_genclass_t *pclass) { unsigned ocpy_option = H5O_CPY_OPTION_DEF; /* Default object copy flags */ + H5O_copy_dtype_merge_list_t *merge_comm_dtype_list = H5O_CPY_MERGE_COMM_DT_LIST_DEF; /* Default merge committed dtype list */ + H5O_mcdt_cb_info_t mcdt_cb = H5O_CPY_MCDT_SEARCH_CB_DEF; /* Default callback before searching the global list of committed datatypes at destination */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -121,12 +143,222 @@ H5P_ocpy_reg_prop(H5P_genclass_t *pclass) if(H5P_register_real(pclass, H5O_CPY_OPTION_NAME, H5O_CPY_OPTION_SIZE, &ocpy_option, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register merge named dtype list property */ + if(H5P_register_real(pclass, H5O_CPY_MERGE_COMM_DT_LIST_NAME, H5O_CPY_MERGE_COMM_DT_LIST_SIZE, &merge_comm_dtype_list, NULL, NULL, NULL, NULL, NULL, H5O_CPY_MERGE_COMM_DT_LIST_CMP, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register property for callback when completing the search for a matching named datatype from the named dtype list */ + if(H5P_register_real(pclass, H5O_CPY_MCDT_SEARCH_CB_NAME, H5O_CPY_MCDT_SEARCH_CB_SIZE, &mcdt_cb, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_ocpy_reg_prop() */ /*------------------------------------------------------------------------- + * Function: H5P_ocpy_copy + * + * Purpose: Callback routine which is called whenever any object + * copy property list is copied. This routine copies + * the properties from the old list to the new list. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Friday, October 28, 2011 + * + *------------------------------------------------------------------------- + */ +/* ARGSUSED */ +static herr_t +H5P_ocpy_copy(hid_t dst_plist_id, hid_t src_plist_id, void UNUSED *copy_data) +{ + H5O_copy_dtype_merge_list_t *src_dt_list, *dst_dt_list = NULL; /* Source & destination merge named datatype lists */ + H5O_copy_dtype_merge_list_t *dst_dt_list_tail = NULL, *tmp_dt_list = NULL; /* temporary merge named datatype lists */ + H5P_genplist_t *src_plist; /* Pointer to source property list */ + H5P_genplist_t *dst_plist; /* Pointer to destination property list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Verify property list IDs */ + if(NULL == (dst_plist = (H5P_genplist_t *)H5I_object(dst_plist_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object copy property list") + if(NULL == (src_plist = (H5P_genplist_t *)H5I_object(src_plist_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object copy property list") + + /* Get the merge committed dtype list property from the old property list */ + if(H5P_get(src_plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &src_dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get merge named dtype list") + + /* Make copy of merge committed dtype list */ + while(src_dt_list) { + /* Copy src_dt_list */ + if(NULL == (tmp_dt_list = H5FL_CALLOC(H5O_copy_dtype_merge_list_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + if(NULL == (tmp_dt_list->path = H5MM_strdup(src_dt_list->path))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + + /* Add copied node to dest dtype list */ + if(dst_dt_list_tail) { + dst_dt_list_tail->next = tmp_dt_list; + dst_dt_list_tail = tmp_dt_list; + } /* end if */ + else { + dst_dt_list = tmp_dt_list; + dst_dt_list_tail = tmp_dt_list; + } /* end else */ + tmp_dt_list = NULL; + + /* Advance src_dt_list pointer */ + src_dt_list = src_dt_list->next; + } /* end while */ + + /* Set the merge named dtype list property for the destination property list + */ + if(H5P_set(dst_plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dst_dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set merge committed dtype list") + +done: + if(ret_value < 0) { + dst_dt_list = H5P_free_merge_comm_dtype_list(dst_dt_list); + if(tmp_dt_list) { + tmp_dt_list->path = (char *)H5MM_xfree(tmp_dt_list->path); + tmp_dt_list = H5FL_FREE(H5O_copy_dtype_merge_list_t, tmp_dt_list); + } /* end if */ + } /* end if */ + + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_ocpy_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_ocpy_close + * + * Purpose: Callback routine which is called whenever any object copy + * property list is closed. This routine performs any generic + * cleanup needed on the properties the library put into the + * list. + * + * Return: Success: Non-negative + * Failure: Negative + * + * Programmer: Neil Fortner + * Friday, October 28, 2011 + * + *------------------------------------------------------------------------- + */ +/* ARGSUSED */ +static herr_t +H5P_ocpy_close(hid_t ocpypl_id, void UNUSED *close_data) +{ + H5O_copy_dtype_merge_list_t *dt_list; /* Merge named datatype list */ + H5P_genplist_t *plist; /* Property list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Check arguments */ + if(NULL == (plist = (H5P_genplist_t *)H5I_object(ocpypl_id))) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an object copy property list") + + /* Get the merge named dtype list property from the old property list */ + if(H5P_get(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get merge named dtype list") + + /* Free the merge named dtype list */ + dt_list = H5P_free_merge_comm_dtype_list(dt_list); + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_ocpy_close() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_ocpy_merge_comm_dt_list_cmp + * + * Purpose: Callback routine which is called whenever the merge + * named dtype property in the object copy property list + * is compared. + * + * Return: positive if VALUE1 is greater than VALUE2, negative if + * VALUE2 is greater than VALUE1 and zero if VALUE1 and + * VALUE2 are equal. + * + * Programmer: Neil Fortner + * Friday, October 28, 2011 + * + *------------------------------------------------------------------------- + */ +static int +H5P_ocpy_merge_comm_dt_list_cmp(const void *_dt_list1, const void *_dt_list2, + size_t UNUSED size) +{ + const H5O_copy_dtype_merge_list_t *dt_list1 = *(H5O_copy_dtype_merge_list_t * const *)_dt_list1, /* Create local aliases for values */ + *dt_list2 = *(H5O_copy_dtype_merge_list_t * const *)_dt_list2; + herr_t ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(_dt_list1); + HDassert(_dt_list2); + HDassert(size == sizeof(H5O_copy_dtype_merge_list_t *)); + + /* Walk through the lists, comparing each path. For the lists to be the + * same, the paths must be in the same order. */ + while(dt_list1 && dt_list2) { + /* Compare paths */ + ret_value = HDstrcmp(dt_list1->path, dt_list2->path); + if(ret_value != 0) HGOTO_DONE(ret_value) + + /* Advance to next node */ + dt_list1 = dt_list1->next; + dt_list2 = dt_list2->next; + } /* end while */ + + /* Check if one list is longer than the other */ + if(dt_list1) HGOTO_DONE(1) + if(dt_list2) HGOTO_DONE(-1) + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_ocpy_merge_comm_dt_list_cmp() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_free_merge_comm_dtype_list + * + * Purpose: Frees the provided merge named dtype list + * + * Return: NULL + * + * Programmer: Neil Fortner + * October 27, 2011 + *------------------------------------------------------------------------- + */ +static H5O_copy_dtype_merge_list_t * +H5P_free_merge_comm_dtype_list(H5O_copy_dtype_merge_list_t *dt_list) +{ + H5O_copy_dtype_merge_list_t *tmp_node; + + FUNC_ENTER_NOAPI_NOINIT + + /* Free the list */ + while(dt_list) { + tmp_node = dt_list->next; + (void)H5MM_xfree(dt_list->path); + (void)H5FL_FREE(H5O_copy_dtype_merge_list_t, dt_list); + dt_list = tmp_node; + } /* end while */ + + FUNC_LEAVE_NOAPI(NULL); +} /* H5P_free_merge_comm_dtype_list */ + + +/*------------------------------------------------------------------------- * Function: H5Pset_copy_object * * Purpose: Set properties when copying an object (group, dataset, and datatype) @@ -207,3 +439,206 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_copy_object() */ + +/*------------------------------------------------------------------------- + * Function: H5Padd_merge_committed_dtype_path + * + * Purpose: Adds path to the list of paths to search first in the + * target file when merging committed datatypes during H5Ocopy + * (i.e. when using the H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG flag + * as set by H5Pset_copy_object). If the source named + * dataype is not found in the list of paths created by this + * function, the entire file will be searched. + * + * Usage: H5Padd_merge_committed_dtype_path(plist_id, path) + * hid_t plist_id; IN: Property list to copy object + * const char *path; IN: Path to add to list + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * October 27, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path) +{ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_copy_dtype_merge_list_t *old_list; /* Merge committed dtype list currently present */ + H5O_copy_dtype_merge_list_t *new_obj = NULL; /* New object to add to list */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* Check parameters */ + if(!path) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no path specified") + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get dtype list */ + if(H5P_get(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &old_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get merge named dtype list") + + /* Add the new path to the list */ + if(NULL == (new_obj = H5FL_CALLOC(H5O_copy_dtype_merge_list_t))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + if(NULL == (new_obj->path = H5MM_strdup(path))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") + new_obj->next = old_list; + + /* Update the list stored in the property list */ + if(H5P_set(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &new_obj) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set merge named dtype list") + +done: + if(ret_value < 0) + if(new_obj) { + new_obj->path = (char *)H5MM_xfree(new_obj->path); + new_obj = H5FL_FREE(H5O_copy_dtype_merge_list_t, new_obj); + } /* end if */ + + FUNC_LEAVE_API(ret_value) +} /* end H5Padd_merge_committed_dtype_path() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pfree_merge_committed_dtype_paths + * + * Purpose: Frees and clears the list of paths created by + * H5Padd_merge_committed_dtype_path. A new list may then be + * created by calling H5Padd_merge_committed_dtype_path again. + * + * Usage: H5Pfree_merge_committed_dtype_paths(plist_id) + * hid_t plist_id; IN: Property list to copy object + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Neil Fortner + * October 27, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pfree_merge_committed_dtype_paths(hid_t plist_id) +{ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_copy_dtype_merge_list_t *dt_list; /* Merge committed dtype list currently present */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get dtype list */ + if(H5P_get(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get merge committed dtype list") + + /* Free dtype list */ + dt_list = H5P_free_merge_comm_dtype_list(dt_list); + + /* Update the list stored in the property list (to NULL) */ + if(H5P_set(plist, H5O_CPY_MERGE_COMM_DT_LIST_NAME, &dt_list) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set merge committed dtype list") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pfree_merge_committed_dtype_paths() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_mcdt_search_cb + * + * Purpose: Set the callback function when a matching committed datatype is not found + * from the list of paths stored in the object copy property list. + * H5Ocopy will invoke this callback before searching all committed datatypes + * at destination. + * + * Usage: H5Pset_mcdt_search_cb(plist_id, H5O_mcdt_search_cb_t func, void *op_data) + * hid_t plist_id; IN: Property list to copy object + * H5O_mcdt_search_cb_t func; IN: The callback function + * void *op_data; IN: The user data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; November 28, 2011 + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data) +{ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_mcdt_cb_info_t cb_info; /* Callback info struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* Check if the callback function is NULL and the user data is non-NULL. + * This is almost certainly an error as the user data will not be used. */ + if(!func && op_data) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "callback is NULL while user data is not") + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Populate the callback info struct */ + cb_info.func = func; + cb_info.user_data = op_data; + + /* Set callback info */ + if(H5P_set(plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set callback info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_mcdt_search_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_mcdt_search_cb + * + * Purpose: Retrieves the callback function and user data from the specified + * object copy property list. + * + * Usage: H5Pget_mcdt_search_cb(plist_id, H5O_mcdt_search_cb_t *func, void **op_data) + * hid_t plist_id; IN: Property list to copy object + * H5O_mcdt_search_cb_t *func; OUT: The callback function + * void **op_data; OUT: The user data + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Vailin Choi; November 29, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data) +{ + H5P_genplist_t *plist; /* Property list pointer */ + H5O_mcdt_cb_info_t cb_info; /* Callback info struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + + /* Get the plist structure */ + if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get callback info */ + if(H5P_get(plist, H5O_CPY_MCDT_SEARCH_CB_NAME, &cb_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get callback info") + + if(func) + *func = cb_info.func; + + if(op_data) + *op_data = cb_info.user_data; + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_mcdt_search_cb() */ + diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index d4441a3..9015940 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -30,6 +30,7 @@ #include "H5FDpublic.h" #include "H5Ipublic.h" #include "H5Lpublic.h" +#include "H5Opublic.h" #include "H5MMpublic.h" #include "H5Tpublic.h" #include "H5Zpublic.h" @@ -427,6 +428,10 @@ H5_DLL herr_t H5Pget_elink_cb(hid_t lapl_id, H5L_elink_traverse_t *func, void ** /* Object copy property list (OCPYPL) routines */ H5_DLL herr_t H5Pset_copy_object(hid_t plist_id, unsigned crt_intmd); H5_DLL herr_t H5Pget_copy_object(hid_t plist_id, unsigned *crt_intmd /*out*/); +H5_DLL herr_t H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path); +H5_DLL herr_t H5Pfree_merge_committed_dtype_paths(hid_t plist_id); +H5_DLL herr_t H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data); +H5_DLL herr_t H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data); /* Symbols defined for compatibility with previous versions of the HDF5 API. * diff --git a/src/H5SM.c b/src/H5SM.c index 8c00d34..62efb50 100644 --- a/src/H5SM.c +++ b/src/H5SM.c @@ -1099,7 +1099,7 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, /* Set flags if this message was "written" without error and wasn't a * 'defer' attempt; it is now either fully shared or "shareable". */ - if(mesg_flags && !(defer_flags & H5SM_DEFER)) { + if(mesg_flags) { if(((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE) *mesg_flags |= H5O_MSG_FLAG_SHAREABLE; else { @@ -1109,7 +1109,8 @@ H5SM_try_share(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, unsigned defer_flags, } /* end if */ done: - HDassert(!ret_value || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE + HDassert((ret_value != TRUE) + || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_HERE || ((H5O_shared_t *)mesg)->type == H5O_SHARE_TYPE_SOHM); #ifndef NDEBUG /* If we previously deferred this operation, make sure the saved message diff --git a/test/objcopy.c b/test/objcopy.c index 9188713..6e33bce 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -47,6 +47,7 @@ const char *FILENAME[] = { "objcopy_src", "objcopy_dst", "objcopy_ext", + "objcopy_src2", NULL }; @@ -73,6 +74,7 @@ const char *FILENAME[] = { #define NAME_DATATYPE_VL_VL "vlen of vlen of int" #define NAME_DATASET_SIMPLE "dataset_simple" #define NAME_DATASET_SIMPLE2 "dataset_simple_copy" +#define NAME_DATASET_SIMPLE3 "dataset_simple_another_copy" #define NAME_DATASET_COMPOUND "dataset_compound" #define NAME_DATASET_CHUNKED "dataset_chunked" #define NAME_DATASET_CHUNKED2 "dataset_chunked2" @@ -89,6 +91,9 @@ const char *FILENAME[] = { #define NAME_GROUP_UNCOPIED "/uncopied" #define NAME_GROUP_EMPTY "/empty" #define NAME_GROUP_TOP "/g0" +#define NAME_GROUP_TOP2 "/g1" +#define NAME_GROUP_TOP3 "/g2" +#define NAME_GROUP_TOP4 "/g3" #define NAME_GROUP_SUB "/g0/g00" #define NAME_GROUP_SUB_2 "/g0/g01" #define NAME_GROUP_SUB_SUB "/g0/g00/g000" @@ -8097,6 +8102,3190 @@ error: /*------------------------------------------------------------------------- + * Function: test_copy_committed_datatype_merge + * + * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil Fortner + * Tuesday, October 11, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_committed_datatype_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src1 = -1, fid_src2 = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info_t oinfo; /* Object info */ + haddr_t exp_addr; /* Expected object address */ + char src1_filename[NAME_BUF_SIZE]; + char src2_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + if(reopen) { + TESTING("H5Ocopy(): merging committed datatypes with reopen") + } /* end if */ + else + TESTING("H5Ocopy(): merging committed datatypes") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src1_filename, sizeof src1_filename); + h5_fixname(FILENAME[3], src_fapl, src2_filename, sizeof src2_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source files */ + if((fid_src1 = H5Fcreate(src1_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + if((fid_src2 = H5Fcreate(src2_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate source file 1 + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid_src1, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src1, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file 1 */ + if(H5Fclose(fid_src1) < 0) TEST_ERROR + + /* + * Populate source file 2 + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid_src2, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src2, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file 1 */ + if(H5Fclose(fid_src2) < 0) TEST_ERROR + + + /* open the source files with read-only */ + if((fid_src1 = H5Fopen(src1_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + if((fid_src2 = H5Fopen(src2_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* Create ocpl and set merge named dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * First copy each entire file to the destination file (each with their own + * group), and verify the committed datatypes are merged + */ + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* copy SRC1 to DST */ + if(H5Ocopy(fid_src1, "/", fid_dst, NAME_GROUP_TOP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy SRC2 to DST */ + if(H5Ocopy(fid_src2, "/", fid_dst, NAME_GROUP_TOP2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open SRC1 committed dtype, get address */ + if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open SRC1 dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open SRC2 committed dtype, check address */ + if((tid = H5Topen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open SRC2 dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* + * Now copy only the datasets to the destination file, and verify the committed + * datatypes are merged + */ + /* recreate destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* Create an uncopied object in destination file so that addresses in source and destination files aren't the same */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* copy SRC1 to DST */ + if(H5Ocopy(fid_src1, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy SRC2 to DST */ + if(H5Ocopy(fid_src2, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open SRC1 dset dtype, get address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open SRC2 dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* close the SRC files */ + if(H5Fclose(fid_src1) < 0) TEST_ERROR + if(H5Fclose(fid_src2) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid_src1); + H5Fclose(fid_src2); + H5Fclose(fid_dst); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_committed_datatype_merge */ + + +/*------------------------------------------------------------------------- + * Function: test_copy_committed_datatype_merge_same_file + * + * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy, + * while copying to the same file. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil Fortner + * Tuesday, October 11, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_committed_datatype_merge_same_file(hid_t fcpl, hid_t fapl, hbool_t reopen) +{ + hid_t fid = -1; /* File ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t gid = -1; /* Group ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info_t oinfo; /* Object info */ + haddr_t exp_addr; /* Expected object address */ + char filename[NAME_BUF_SIZE]; + + if(reopen) + TESTING("H5Ocopy(): merging committed datatypes to the source file with reopen") + else + TESTING("H5Ocopy(): merging committed datatypes to the source file") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filename */ + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create file */ + if((fid = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate first group + */ + /* Create group */ + if((gid = H5Gcreate2(fid, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset */ + if((did = H5Dcreate2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the group */ + if(H5Gclose(gid) < 0) TEST_ERROR + + /* + * Populate second group + */ + /* Create group */ + if((gid = H5Gcreate2(fid, NAME_GROUP_TOP2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset */ + if((did = H5Dcreate2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the group */ + if(H5Gclose(gid) < 0) TEST_ERROR + + + /* Create ocpl and set merge committed dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * First copy each group to the destination group 3 (each with their own + * group), and verify the committed datatypes are merged as expected. All + * datatypes copied should reference (share an address with) the + * corresponding source datatype. + */ + /* Create destination group */ + if((gid = H5Gcreate2(fid, NAME_GROUP_TOP3, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Gclose(gid) < 0) TEST_ERROR + + /* copy group 1 to DST */ + if(H5Ocopy(fid, NAME_GROUP_TOP, fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy group 2 to DST */ + if(H5Ocopy(fid, NAME_GROUP_TOP2, fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid) < 0) TEST_ERROR + if((fid = H5Fopen(filename, H5F_ACC_RDWR, fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open group 1 source committed dtype, get address */ + if((tid = H5Topen2(fid, NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open group 1 source dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 1 committed dtype, check address */ + if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open group 1 dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 2 source committed dtype, get address and make sure it is + * different from group 1 source committed dtype */ + if((tid = H5Topen2(fid, NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open group 2 source dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 2 committed dtype, check address */ + if((tid = H5Topen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open group 2 dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP3 "/" NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* + * Now copy only the datasets to the destination group, and verify the committed + * datatypes are merged as expected + */ + /* Create destination group */ + if((gid = H5Gcreate2(fid, NAME_GROUP_TOP4, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Gclose(gid) < 0) TEST_ERROR + + /* copy SRC1 to DST */ + if(H5Ocopy(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy SRC2 to DST */ + if(H5Ocopy(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid) < 0) TEST_ERROR + if((fid = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open group 1 source dset dtype, get address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 1 dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 2 source dset dtype, get address and make sure it is + * different from group 1 source dset dtype */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP2 "/" NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open group 2 dset dtype, check address */ + if((did = H5Dopen2(fid, NAME_GROUP_TOP4 "/" NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close file */ + if(H5Fclose(fid) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_committed_datatype_merge_same_file */ + + + +/*------------------------------------------------------------------------- + * Function: test_copy_committed_dt_merge_sugg + * + * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy, and + * uses the suggestion list feature + * (H5Padd_merge_committed_dtype_path). + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil Fortner + * Thursday, November 3, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_committed_dt_merge_sugg(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info_t oinfo; /* Object info */ + haddr_t exp_addr; /* Expected object address */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + if(reopen) + TESTING("H5Ocopy(): merging committed datatypes with suggestions and reopen") + else + TESTING("H5Ocopy(): merging committed datatypes with suggestions") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source file */ + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate source file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* + * Populate destination file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "a" */ + if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "b" */ + if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* Create ocpl and set merge committed dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * First copy dataset using "/b" as a suggestion, and verify that it uses + * datatype "b" in the destination file + */ + /* Add datatype suggestion */ + if(H5Padd_merge_committed_dtype_path(ocpypl_id, "/b") < 0) TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "b", get address */ + if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* + * Now free suggestions, copy dataset without any suggestions, and verify + * that it uses datatype "a" in the destination file + */ + /* Free suggestions */ + if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* Delete destination dataset */ + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "a", get address */ + if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open dset 2 dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open committed dtype "b", get address */ + if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid_src); + H5Fclose(fid_dst); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_committed_dt_merge_sugg */ + + +/*------------------------------------------------------------------------- + * Function: test_copy_committed_dt_merge_attr + * + * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy, with + * an attribute using an anonymous committed type in the + * destination. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil Fortner + * Thursday, November 3, 2011 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_committed_dt_merge_attr(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t gid = -1; /* Group ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info_t oinfo; /* Object info */ + haddr_t exp_addr; /* Expected object address */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + if(reopen) + TESTING("H5Ocopy(): merging committed datatypes with attributes and reopen") + else + TESTING("H5Ocopy(): merging committed datatypes with attributes") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source file */ + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate source file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* + * Populate destination file + */ + /* Create group */ + if((gid = H5Gcreate2(fid_dst, NAME_GROUP_TOP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* create anonymous committed data type */ + if((H5Tcommit_anon(fid_dst, tid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create attribute at SRC file */ + if((aid = H5Acreate2(gid, "attr", tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Awrite(aid, tid, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the attribute */ + if(H5Aclose(aid) < 0) TEST_ERROR + + /* close the group */ + if(H5Gclose(gid) < 0) TEST_ERROR + + /* close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* Create ocpl and set merge committed dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * Copy dataset and verify that it uses the same committed datatype as the + * already existing attribute in the destination file. + */ + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open attribute dtype, get address */ + if((aid = H5Aopen_by_name(fid_dst, NAME_GROUP_TOP, "attr", H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Aget_type(aid)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Aclose(aid) < 0) TEST_ERROR + + /* Open dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid_src); + H5Fclose(fid_dst); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Aclose(aid); + H5Gclose(gid); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_committed_dt_merge_attr */ + +/* + * Defines used for the committed datatype tests + */ +#define SRC_ROOT_GROUP "src_root" +#define ROOT_NDT_INT "root_ndt_int" +#define GROUP_NDT_SHORT "group_ndt_short" + +#define SRC_GRP "src_grp" +#define DST_GRP "dst_grp" +#define DST_GRP2 "dst_grp2" + +#define SRC_NDT_SHORT "src_ndt_short" +#define SRC_NDT_INT "src_ndt_int" +#define SRC_NDT_INT2 "src_ndt_int2" +#define SRC_NDT_FLOAT "src_ndt_float" +#define SRC_NDT_DOUBLE "src_ndt_double" + +#define DST_NDT_SHORT "dst_ndt_short" +#define DST_NDT_INT "dst_ndt_int" +#define DST_NDT_FLOAT "dst_ndt_float" +#define DST_NDT_DOUBLE "dst_ndt_double" + +#define SRC_NDT_DSET "src_ndt_dset" +#define SRC_NDT_DSET2 "src_ndt_dset2" +#define SRC_NDT_DSET3 "src_ndt_dset3" + +#define SRC_DSET "src_dset" +#define SRC_DSET1 "src_dset1" + +#define SRC_ATTR "src_attr" + +#define DST_ATTR_ANON_SHORT "dst_attr_anon_short" +#define DST_ATTR_ANON_INT "dst_attr_anon_int" + +#define DST_ATTR "dst_attr" +#define DST_ATTR2 "dst_attr2" + +/*------------------------------------------------------------------------- + * Function: test_copy_cdt_hier_merge + * + * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy: + * SRC file: + * Create committed datatypes at / and /g0 + * Create datasets with native type and committed datatypes at /g0 + * DST file: + * Create attributes with anonymous committed datatypes at /uncopied + * + * Copy / at SRC to DST + * Copy /g0 at SRC to DST + * Copy the datasets in /g0 at SRC to DST /uncopied + * Verify that committed datatypes are copied and merged correctly + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Vailin Choi; January 2012 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_cdt_hier_merge(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t gid = -1; /* Group IDs */ + hid_t f_tid = -1; /* Datatype ID for root group */ + hid_t g_tid = -1; /* Datatype ID for group */ + hid_t anon_tid = -1; /* Anonymous datatype */ + hid_t aid = -1; /* Attribute ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + int i; /* Local index variable */ + hsize_t dim1d[1]; /* dimension sizes */ + int buf[DIM_SIZE_1]; /* Buffer for data */ + haddr_t exp_addr_int, exp_addr_short; /* Expected object addresses */ + H5O_info_t oinfo; /* Object info */ + char src_filename[NAME_BUF_SIZE]; /* Source file name */ + char dst_filename[NAME_BUF_SIZE]; /* Destination file name */ + + if(reopen) + TESTING("H5Ocopy(): hier. of committed datatypes and merging with reopen") + else + TESTING("H5Ocopy(): hier. of committed datatypes and merging ") + + /* set initial data values */ + for (i=0; icalled++; + return(udata->search_action); +} /* mcdt_search_cb() */ + +static int +test_copy_set_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + H5O_info_t oinfo; /* Object info */ + haddr_t exp_addr; /* Expected object address */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + mcdt_search_cb_ud cb_udata; /* User data for callback */ + + if(reopen) + TESTING("H5Ocopy(): H5Pset_mcdt_search_cb and reopen") + else + TESTING("H5Ocopy(): H5Pset_mcdt_search_cb") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source file */ + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate source file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* named data type */ + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* Create an uncopied group in destination file */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* + * Populate destination file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "a" */ + if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "b" */ + if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* Create ocpl and set merge committed dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * First copy dataset using "/b" as a suggestion, and verify that it uses + * datatype "b" in the destination file + */ + /* Add datatype suggestion */ + if(H5Padd_merge_committed_dtype_path(ocpypl_id, "/b") < 0) TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "b", get address */ + if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open dset dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* + * Set callback to continue the search + */ + cb_udata.search_action = H5O_MCDT_SEARCH_CONT; + cb_udata.called = 0; + + /* Free suggestions */ + if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR + + /* Add datatype suggestion to group "/uncopied" */ + if(H5Padd_merge_committed_dtype_path(ocpypl_id, NAME_GROUP_UNCOPIED) < 0) TEST_ERROR + + /* Continue the global search */ + if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cb, &cb_udata) < 0) + TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify callback has been called exactly once */ + if(cb_udata.called != 1) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "a", get address */ + if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open copied dataset and its dtype, check address */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE2, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr != exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* + * Stop the search, default action is to create an anonymous committed datatype + */ + cb_udata.search_action = H5O_MCDT_SEARCH_STOP; + cb_udata.called = 0; + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify callback has been called exactly once */ + if(cb_udata.called != 1) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "a", get address */ + if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open the copied dataset and get its dtype, addresses should not be equal */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open committed dtype "b", get address */ + if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open the copied dataset and get its dtype, addresses should not be equal */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* + * Stop the search, default action is to create an anonymous committed datatype. + * Disable suggestion list. + */ + cb_udata.search_action = H5O_MCDT_SEARCH_STOP; + cb_udata.called = 0; + + /* Free suggestions */ + if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* Delete dataset */ + if(H5Ldelete(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + /* Verify callback has been called exactly once */ + if(cb_udata.called != 1) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Open committed dtype "a", get address */ + if((tid = H5Topen2(fid_dst, "/a", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open the copied dataset and get its dtype, addresses should not be equal */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Open committed dtype "b", get address */ + if((tid = H5Topen2(fid_dst, "/b", H5P_DEFAULT)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + exp_addr = oinfo.addr; + if(H5Tclose(tid) < 0) TEST_ERROR + + /* Open the copied dataset and get its dtype, addresses should not be equal */ + if((did = H5Dopen2(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT)) < 0) TEST_ERROR + if((tid = H5Dget_type(did)) < 0) TEST_ERROR + if(H5Oget_info(tid, &oinfo) < 0) TEST_ERROR + if(oinfo.addr == exp_addr) TEST_ERROR + if(H5Tclose(tid) < 0) TEST_ERROR + if(H5Dclose(did) < 0) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid_src); + H5Fclose(fid_dst); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_set_mcdt_search_cb */ + + +/*------------------------------------------------------------------------- + * Function: test_copy_set_get_mcdt_cb + * + * Purpose: Tests for the "H5Pset/get_mcdt_search_cb" feature of H5Ocopy. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Vailin Choi; January 2012 + * + *------------------------------------------------------------------------- + */ + +/* The user callback functions */ +static H5O_mcdt_search_ret_t +mcdt_search_cbA(void *_udata) +{ + H5O_mcdt_search_ret_t *action = (H5O_mcdt_search_ret_t *)_udata; + + return(*action); +} /* mcdt_search_cb() */ + +static H5O_mcdt_search_ret_t +mcdt_search_cbB(void *_udata) +{ + H5O_mcdt_search_ret_t *action = (H5O_mcdt_search_ret_t *)_udata; + + return(*action); +} /* mnt_search_cb() */ + +/* The main test function */ +static int +test_copy_set_get_mcdt_search_cb(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, + hid_t dst_fapl, hbool_t reopen) +{ + hid_t fid_src = -1, fid_dst = -1; /* File IDs */ + hid_t tid = -1; /* Datatype ID */ + hid_t sid = -1; /* Dataspace ID */ + hid_t did = -1; /* Dataset ID */ + hid_t ocpypl_id = -1; /* Object copy plist ID */ + unsigned int i; /* Local index variables */ + hsize_t dim1d[1]; /* Dataset dimensions */ + int buf[DIM_SIZE_1]; /* Buffer for writing data */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + H5O_mcdt_search_cb_t mcdt_cb = NULL; /* The callback function */ + H5O_mcdt_search_ret_t mcdt_udataA; /* User data for callback */ + H5O_mcdt_search_ret_t mcdt_udataB; /* User data for callback */ + H5O_mcdt_search_ret_t *mcdt_udata_p = NULL; /* Pointer to user data for callback */ + + if(reopen) + TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb and reopen") + else + TESTING("H5Ocopy(): H5Pset/get_mcdt_search_cb") + + /* set initial data values */ + for(i = 0; i < DIM_SIZE_1; i++) + buf[i] = (int)i; + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], dst_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* create source file */ + if((fid_src = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) TEST_ERROR + + /* Set dataspace dimensions */ + dim1d[0]=DIM_SIZE_1; + + /* create dataspace */ + if((sid = H5Screate_simple(1, dim1d, NULL)) < 0) TEST_ERROR + + /* + * Populate source file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type */ + if((H5Tcommit2(fid_src, NAME_DATATYPE_SIMPLE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* create dataset at SRC file */ + if((did = H5Dcreate2(fid_src, NAME_DATASET_SIMPLE, tid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* write data into file */ + if(H5Dwrite(did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the dataset */ + if(H5Dclose(did) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* create destination file */ + if((fid_dst = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) TEST_ERROR + + /* Create an uncopied group in destination file */ + if(H5Gclose(H5Gcreate2(fid_dst, NAME_GROUP_UNCOPIED, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* + * Populate destination file + */ + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "a" */ + if((H5Tcommit2(fid_dst, "/a", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* create datatype */ + if((tid = H5Tcopy(H5T_NATIVE_INT)) < 0)TEST_ERROR + + /* committed data type "b" */ + if((H5Tcommit2(fid_dst, "/b", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR + + /* close the datatype */ + if(H5Tclose(tid) < 0) TEST_ERROR + + /* close the DST file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* open the source file with read-only */ + if((fid_src = H5Fopen(src_filename, H5F_ACC_RDONLY, src_fapl)) < 0) TEST_ERROR + + /* Create ocpl and set merge committed dtype flag */ + if((ocpypl_id = H5Pcreate(H5P_OBJECT_COPY)) < 0) TEST_ERROR + if(H5Pset_copy_object(ocpypl_id, H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG) < 0) TEST_ERROR + + /* + * First copy dataset using "/b" as a suggestion, and verify that it uses + * datatype "b" in the destination file + */ + /* Add datatype suggestion */ + if(H5Padd_merge_committed_dtype_path(ocpypl_id, "/b") < 0) TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + /* Verify "get" routine functionality */ + if(H5Pget_mcdt_search_cb(ocpypl_id, &mcdt_cb, (void **) &mcdt_udata_p) < 0) TEST_ERROR + + if(mcdt_cb != NULL) TEST_ERROR + if(mcdt_udata_p != NULL) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* + * Set callback to continue the search + */ + mcdt_udataA = H5O_MCDT_SEARCH_CONT; + + /* Free suggestions */ + if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR + + /* Add datatype suggestion to group "/uncopied" */ + if(H5Padd_merge_committed_dtype_path(ocpypl_id, NAME_GROUP_UNCOPIED) < 0) TEST_ERROR + + /* Continue the global search */ + if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataA) < 0) + TEST_ERROR + + /* open the destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE2, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + mcdt_cb = NULL; + mcdt_udata_p = NULL; + + /* Verify "get" routine functionality */ + if(H5Pget_mcdt_search_cb(ocpypl_id, &mcdt_cb, (void **) &mcdt_udata_p) < 0) TEST_ERROR + + if(mcdt_cb != mcdt_search_cbA) TEST_ERROR + if(mcdt_udata_p != &mcdt_udataA) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + + /* + * Stop the search, default action is to create an anonymous committed datatype + */ + mcdt_udataB = H5O_MCDT_SEARCH_STOP; + + if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbA, &mcdt_udataB) < 0) + TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + mcdt_cb = NULL; + mcdt_udata_p = NULL; + + /* Verify "get" routine functionality */ + if(H5Pget_mcdt_search_cb(ocpypl_id, &mcdt_cb, (void **) &mcdt_udata_p) < 0) TEST_ERROR + + if(mcdt_cb != mcdt_search_cbA) TEST_ERROR + if(mcdt_udata_p != &mcdt_udataB) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* Free suggestions */ + if(H5Pfree_merge_committed_dtype_paths(ocpypl_id) < 0) TEST_ERROR + + if(H5Pset_mcdt_search_cb(ocpypl_id, mcdt_search_cbB, &mcdt_udataB) < 0) + TEST_ERROR + + /* open destination file */ + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDWR, dst_fapl)) < 0) TEST_ERROR + + /* Delete dataset */ + if(H5Ldelete(fid_dst, NAME_DATASET_SIMPLE3, H5P_DEFAULT) < 0) TEST_ERROR + + /* copy SRC dset to DST */ + if(H5Ocopy(fid_src, NAME_DATASET_SIMPLE, fid_dst, NAME_DATASET_SIMPLE3, ocpypl_id, H5P_DEFAULT) < 0) TEST_ERROR + + if(reopen) { + /* Reopen file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + if((fid_dst = H5Fopen(dst_filename, H5F_ACC_RDONLY, dst_fapl)) < 0) TEST_ERROR + } /* end if */ + + mcdt_cb = NULL; + mcdt_udata_p = NULL; + + /* Verify "get" routine functionality */ + if(H5Pget_mcdt_search_cb(ocpypl_id, &mcdt_cb, (void **) &mcdt_udata_p) < 0) TEST_ERROR + + if(mcdt_cb != mcdt_search_cbB) TEST_ERROR + if(mcdt_udata_p != &mcdt_udataB) TEST_ERROR + + /* Close destination file */ + if(H5Fclose(fid_dst) < 0) TEST_ERROR + + /* close the SRC file */ + if(H5Fclose(fid_src) < 0) TEST_ERROR + + /* close property list */ + if(H5Pclose(ocpypl_id) < 0) TEST_ERROR + + /* close dataspace */ + if(H5Sclose(sid) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Fclose(fid_src); + H5Fclose(fid_dst); + H5Tclose(tid); + H5Sclose(sid); + H5Dclose(did); + H5Pclose(ocpypl_id); + } H5E_END_TRY; + return 1; +} /* end test_copy_set_get_mcdt_search_cb */ + + +/*------------------------------------------------------------------------- * Function: test_copy_option * * Purpose: Create a group in SRC file and copy it to DST file @@ -8727,6 +11916,7 @@ main(void) unsigned max_compact, min_dense; int configuration; /* Configuration of tests. */ int ExpressMode; + hbool_t same_file; /* Whether to run tests that only use one file */ /* Setup */ h5_reset(); @@ -8759,6 +11949,11 @@ main(void) hid_t fcpl_src; hid_t fcpl_dst; + /* Start with same_file == TRUE. Use source file settings for these + * tests. Don't run with a non-default destination file setting, as + * destination settings have no effect. */ + same_file = TRUE; + /* No need to test dense attributes with old format */ if(!(configuration & CONFIG_SRC_NEW_FORMAT) && (configuration & CONFIG_DENSE)) continue; @@ -8775,6 +11970,7 @@ main(void) if(configuration & CONFIG_SHARE_DST) { puts("Testing with shared dst messages:"); fcpl_dst = fcpl_shared; + same_file = FALSE; } else { puts("Testing without shared dst messages:"); @@ -8797,7 +11993,7 @@ main(void) } } /* end if */ else { - puts("Testing with oldest file format for source file:"); + puts("Testing with oldest file format for source file:"); src_fapl = fapl; num_attributes_g = 4; } /* end else */ @@ -8806,6 +12002,7 @@ main(void) if(configuration & CONFIG_DST_NEW_FORMAT) { puts("Testing with latest format for destination file:"); dst_fapl = fapl2; + same_file = FALSE; } /* end if */ else { puts("Testing with oldest file format for destination file:"); @@ -8873,10 +12070,32 @@ main(void) /* Tests that do not use attributes and do not need to be tested * multiple times for different attribute configurations */ if(configuration < CONFIG_DENSE) { + hbool_t reopen; + nerrors += test_copy_named_datatype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_named_datatype_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_named_datatype_vl_vl(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + /* Loop over reopening the file */ + for(reopen = FALSE; reopen <= TRUE; reopen++) { + nerrors += test_copy_committed_datatype_merge(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + + if(same_file) + nerrors += test_copy_committed_datatype_merge_same_file(fcpl_src, src_fapl, reopen); + + nerrors += test_copy_committed_dt_merge_sugg(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_committed_dt_merge_attr(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + + /* tests added for merging committed datatypes + suggestions + callback */ + nerrors += test_copy_cdt_hier_merge(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_cdt_merge_cdt(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_cdt_merge_suggs(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_cdt_merge_dset_suggs(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_cdt_merge_all_suggs(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_set_mcdt_search_cb(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + nerrors += test_copy_set_get_mcdt_search_cb(fcpl_src, fcpl_dst, src_fapl, dst_fapl, reopen); + } /* end for */ + nerrors += test_copy_dataset_external(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_dataset_named_dtype(fcpl_src, fcpl_dst, src_fapl, dst_fapl); nerrors += test_copy_dataset_named_dtype_hier(fcpl_src, fcpl_dst, src_fapl, dst_fapl); -- cgit v0.12 From 84487458917a55d39171cb4607178e4ba25a208d Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Wed, 28 Mar 2012 16:02:30 -0500 Subject: [svn-r22173] Purpose: Fix HDFFV-7762 Description: When copying an object with attribute creation order tracked, the attribute creation order was not copied correctly to the destination file, causing an error if the creation order was also indexed (due to attempting to insert duplicate keys) or incorrect creation orders otherwise. Fixed to copy the creation order correctly. Also fixed the attribute character set not being copied, and fixed an issue where an attribute opened with H5Aopen (or similar, but not by_idx), from an object using the latest format but without creation order being tracked, would always report the creation order as 0 (and marked as valid). Tested: jam, koala, ostrich (h5committest), durandal --- release_docs/RELEASE.txt | 2 + src/H5Aint.c | 10 +++ src/H5Oattribute.c | 6 +- test/objcopy.c | 170 ++++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 185 insertions(+), 3 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 58ad605..e2ab4ce 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -373,6 +373,8 @@ Bug Fixes since HDF5-1.8.0 release Library ------- + - Fixed an error that would occur when copying an object with attribute + creation order tracked and indexed. (NAF - 2012/3/28 - HDFFV-7762) - Fixed a bug in H5Ocopy(): When copying an opened object, call the object's flush class action to ensure that cached data is flushed so that H5Ocopy will get the correct data. diff --git a/src/H5Aint.c b/src/H5Aint.c index 8475330..74c5590 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -795,6 +795,12 @@ H5A_set_version(const H5F_t *f, H5A_t *attr) * * Purpose: Copies a message from _MESG to _DEST in file * + * Note that this function assumes that it is copying *all* + * the attributes in the object, specifically when it copies + * the creation order from source to destination. If this is + * to be used to copy only a single attribute, then the + * creation order must be handled differently. -NAF + * * Return: Success: Ptr to _DEST * * Failure: NULL @@ -849,6 +855,7 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si /* Copy attribute's name */ attr_dst->shared->name = H5MM_strdup(attr_src->shared->name); HDassert(attr_dst->shared->name); + attr_dst->shared->encoding = attr_src->shared->encoding; /* Copy attribute's datatype */ /* If source is named, we will keep dst as named, but we will not actually @@ -1003,6 +1010,9 @@ H5A_attr_copy_file(const H5A_t *attr_src, H5F_t *file_dst, hbool_t *recompute_si } /* end else */ } /* end if(attr_src->shared->data) */ + /* Copy the creation order */ + attr_dst->shared->crt_idx = attr_src->shared->crt_idx; + /* Recompute the version to encode the destination attribute */ if(H5A_set_version(file_dst, attr_dst) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, NULL, "unable to update attribute version") diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 5778dc1..055fb69 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -434,8 +434,10 @@ H5O_attr_open_cb(H5O_t *oh, H5O_mesg_t *mesg/*in,out*/, unsigned sequence, if(NULL == (udata->attr = H5A_copy(NULL, (H5A_t *)mesg->native))) HGOTO_ERROR(H5E_ATTR, H5E_CANTCOPY, H5_ITER_ERROR, "unable to copy attribute") - /* Assign [somewhat arbitrary] creation order value, for older versions of the format */ - if(oh->version == H5O_VERSION_1) + /* Assign [somewhat arbitrary] creation order value, for older versions + * of the format or if creation order is not tracked */ + if(oh->version == H5O_VERSION_1 + || !(oh->flags & H5O_HDR_ATTR_CRT_ORDER_TRACKED)) udata->attr->shared->crt_idx = sequence; /* Stop iterating */ diff --git a/test/objcopy.c b/test/objcopy.c index 6e33bce..ce0f3d3 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -545,12 +545,17 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id) char attr_name[ATTR_NAME_LEN]; int attr_data[2]; hsize_t dim1 = 2; + hid_t acpl = -1; unsigned u; int ret_value = -1; if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) goto done; + /* Create attribute creation plist */ + if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) + goto done; + for(u = 0; u < num_attributes_g; u++) { sprintf(attr_name, "%u attr", u); @@ -558,7 +563,16 @@ test_copy_attach_attributes(hid_t loc_id, hid_t type_id) attr_data[0] = (int)(100 * u); attr_data[1] = (int)(200 * u); - if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) + /* Set attribute character set (alternate) */ + if(u % 2) { + if(H5Pset_char_encoding(acpl, H5T_CSET_ASCII) < 0) + goto done; + } /* end if */ + else + if(H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0) + goto done; + + if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, acpl, H5P_DEFAULT)) < 0) goto done; if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0) @@ -577,6 +591,8 @@ done: H5Sclose(sid); if(aid > 0) H5Aclose(aid); + if(acpl > 0) + H5Pclose(acpl); return ret_value; } @@ -600,11 +616,15 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) hid_t aid = -1, sid = -1; char attr_name[ATTR_NAME_LEN]; int attr_data[2]; + hid_t acpl = -1; unsigned u; hsize_t dim1 = 2; if((sid = H5Screate_simple(1, &dim1, NULL)) < 0 ) goto done; + /* Create attribute creation plist */ + if((acpl = H5Pcreate(H5P_ATTRIBUTE_CREATE)) < 0) goto done; + for(u = 0; u < num_attributes_g; u++) { sprintf(attr_name, "%u attr", u); @@ -612,6 +632,13 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) attr_data[0] = (int)(100 * u); attr_data[1] = (int)(200 * u); + /* Set attribute character set (alternate) */ + if(u % 2) { + if(H5Pset_char_encoding(acpl, H5T_CSET_ASCII) < 0) goto done; + } /* end if */ + else + if(H5Pset_char_encoding(acpl, H5T_CSET_UTF8) < 0) goto done; + /* Add attribute to first object */ if((aid = H5Acreate2(loc_id, attr_name, type_id, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto done; if(H5Awrite(aid, H5T_NATIVE_INT, attr_data) < 0) goto done; @@ -624,6 +651,7 @@ test_copy_attach_paired_attributes(hid_t loc_id, hid_t loc_id2, hid_t type_id) } if(H5Sclose(sid) < 0) goto done; + if(H5Pclose(acpl) < 0) goto done; return 0; @@ -632,6 +660,8 @@ done: H5Sclose(sid); if(aid > 0) H5Aclose(aid); + if(acpl > 0) + H5Pclose(acpl); return -1; } /* end test_copy_attach_paired_attributes() */ @@ -657,10 +687,22 @@ compare_attribute(hid_t aid, hid_t aid2, hid_t pid, const void *wbuf, hid_t obj_ size_t elmt_size; /* Size of datatype */ htri_t is_committed; /* If the datatype is committed */ htri_t is_committed2; /* If the datatype is committed */ + H5A_info_t ainfo; /* Attribute info */ + H5A_info_t ainfo2; /* Attribute info */ hssize_t nelmts; /* # of elements in dataspace */ void *rbuf = NULL; /* Buffer for reading raw data */ void *rbuf2 = NULL; /* Buffer for reading raw data */ + /* Check the character sets are equal */ + if(H5Aget_info(aid, &ainfo) < 0) TEST_ERROR + if(H5Aget_info(aid2, &ainfo2) < 0) TEST_ERROR + if(ainfo.cset != ainfo2.cset) TEST_ERROR + + /* Check the creation orders are equal (if appropriate) */ + if(ainfo.corder_valid != ainfo2.corder_valid) TEST_ERROR + if(ainfo.corder_valid) + if(ainfo.corder != ainfo2.corder) TEST_ERROR + /* Check the datatypes are equal */ /* Open the datatype for the source attribute */ @@ -1276,7 +1318,9 @@ compare_datasets(hid_t did, hid_t did2, hid_t pid, const void *wbuf) /* Release raw data buffers */ HDfree(rbuf); + rbuf = NULL; HDfree(rbuf2); + rbuf2 = NULL; /* close the source dataspace */ if(H5Sclose(sid) < 0) TEST_ERROR @@ -8102,6 +8146,128 @@ error: /*------------------------------------------------------------------------- + * Function: test_copy_attr_crt_order + * + * Purpose: Tests copying attributes with creation order tracked, with + * and without creation order being indexed. + * + * Return: Success: 0 + * Failure: number of errors + * + * Programmer: Neil Fortner + * Friday, January 20, 2012 + * + *------------------------------------------------------------------------- + */ +static int +test_copy_attr_crt_order(hid_t fcpl_src, hid_t fcpl_dst, hid_t src_fapl, hid_t dst_fapl) +{ + hid_t fid1 = -1, fid2 = -1; /* File IDs */ + hid_t gcplid = -1; /* Group creation property list ID */ + hid_t gid1 = -1, gid2 = -1; /* Group IDs */ + char src_filename[NAME_BUF_SIZE]; + char dst_filename[NAME_BUF_SIZE]; + + TESTING("H5Ocopy(): attributes with creation order"); + + /* Initialize the filenames */ + h5_fixname(FILENAME[0], src_fapl, src_filename, sizeof src_filename); + h5_fixname(FILENAME[1], src_fapl, dst_filename, sizeof dst_filename); + + /* Reset file address checking info */ + addr_reset(); + + /* Create source file */ + if((fid1 = H5Fcreate(src_filename, H5F_ACC_TRUNC, fcpl_src, src_fapl)) < 0) + TEST_ERROR + + /* Create GCPL */ + if((gcplid = H5Pcreate(H5P_GROUP_CREATE)) < 0) TEST_ERROR + + /* Create group with creation order tracked */ + if(H5Pset_attr_creation_order(gcplid, H5P_CRT_ORDER_TRACKED) < 0) TEST_ERROR + if((gid1 = H5Gcreate2(fid1, NAME_GROUP_TOP, H5P_DEFAULT, gcplid, H5P_DEFAULT)) + < 0) + TEST_ERROR + + /* Add attributes to group */ + if(test_copy_attach_attributes(gid1, H5T_NATIVE_INT) < 0) TEST_ERROR + + /* Close group */ + if(H5Gclose(gid1) < 0) TEST_ERROR + + /* Create group with creation order tracked and indexed */ + if(H5Pset_attr_creation_order(gcplid, H5P_CRT_ORDER_TRACKED + | H5P_CRT_ORDER_INDEXED) < 0) + TEST_ERROR + if((gid1 = H5Gcreate2(fid1, NAME_GROUP_TOP2, H5P_DEFAULT, gcplid, + H5P_DEFAULT)) < 0) + TEST_ERROR + + /* Add attributes to group */ + if(test_copy_attach_attributes(gid1, H5T_NATIVE_INT) < 0) TEST_ERROR + + /* Close group */ + if(H5Gclose(gid1) < 0) TEST_ERROR + + /* Close GCPL */ + if(H5Pclose(gcplid) < 0) TEST_ERROR + + + /* Create destination file */ + if((fid2 = H5Fcreate(dst_filename, H5F_ACC_TRUNC, fcpl_dst, dst_fapl)) < 0) + TEST_ERROR + + /* Copy the groups to the destination file */ + if(H5Ocopy(fid1, NAME_GROUP_TOP, fid2, NAME_GROUP_TOP, H5P_DEFAULT, + H5P_DEFAULT) < 0) + TEST_ERROR + if(H5Ocopy(fid1, NAME_GROUP_TOP2, fid2, NAME_GROUP_TOP2, H5P_DEFAULT, + H5P_DEFAULT) < 0) + TEST_ERROR + + /* Open groups with creation order tracked */ + if((gid1 = H5Gopen2(fid1, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid2, NAME_GROUP_TOP, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Compare the attributes */ + if(compare_std_attributes(gid1, gid2, H5P_DEFAULT) != TRUE) TEST_ERROR + + /* Close groups */ + if(H5Gclose(gid1) < 0) TEST_ERROR + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Open groups with creation order tracked and indexed */ + if((gid1 = H5Gopen2(fid1, NAME_GROUP_TOP2, H5P_DEFAULT)) < 0) TEST_ERROR + if((gid2 = H5Gopen2(fid2, NAME_GROUP_TOP2, H5P_DEFAULT)) < 0) TEST_ERROR + + /* Compare the attributes */ + if(compare_std_attributes(gid1, gid2, H5P_DEFAULT) != TRUE) TEST_ERROR + + /* Close groups */ + if(H5Gclose(gid1) < 0) TEST_ERROR + if(H5Gclose(gid2) < 0) TEST_ERROR + + /* Close */ + if(H5Fclose(fid1) < 0) TEST_ERROR + if(H5Fclose(fid2) < 0) TEST_ERROR + + PASSED(); + return 0; + +error: + H5E_BEGIN_TRY { + H5Gclose(gid1); + H5Gclose(gid2); + H5Pclose(gcplid); + H5Fclose(fid1); + H5Fclose(fid2); + } H5E_END_TRY; + return 1; +} /* end test_copy_attr_crt_order */ + + +/*------------------------------------------------------------------------- * Function: test_copy_committed_datatype_merge * * Purpose: Tests the "merge committed datatypes" feature of H5Ocopy. @@ -12038,6 +12204,8 @@ main(void) nerrors += test_copy_named_datatype_attr_self(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_attr_crt_order(fcpl_src, fcpl_dst, src_fapl, dst_fapl); + nerrors += test_copy_option(fcpl_src, fcpl_dst, src_fapl, dst_fapl, H5O_COPY_WITHOUT_ATTR_FLAG, FALSE, "H5Ocopy(): without attributes"); -- cgit v0.12 From d4ab4456d021dbe21cec5265d77047949f61eda7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 28 Mar 2012 17:00:41 -0500 Subject: [svn-r22175] MinGW compile issues fixed. Reviewed Tested: windows (big test using stdio ony fails - this will be filed for further investigation) --- config/cmake/ConfigureChecks.cmake | 16 +++++++++++----- config/cmake/H5pubconf.h.in | 3 +++ src/H5FDstdio.c | 6 ++++++ src/H5win32defs.h | 6 ++++-- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 963152c..0a078b6 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -129,6 +129,10 @@ ENDMACRO (CHECK_LIBRARY_EXISTS_CONCAT) SET (WINDOWS) IF (WIN32) + IF (MINGW) + SET (H5_HAVE_MINGW 1) + SET (WINDOWS 1) # MinGW tries to imitate Windows + ENDIF (MINGW) SET (H5_HAVE_WIN32_API 1) IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) @@ -174,7 +178,9 @@ IF (WINDOWS) SET (H5_HAVE_DIFFTIME 1) SET (H5_HAVE_LONGJMP 1) SET (H5_STDC_HEADERS 1) - SET (H5_HAVE_GETHOSTNAME 1) + IF (NOT MINGW) + SET (H5_HAVE_GETHOSTNAME 1) + ENDIF (NOT MINGW) SET (H5_HAVE_GETCONSOLESCREENBUFFERINFO 1) SET (H5_HAVE_FUNCTION 1) SET (H5_GETTIMEOFDAY_GIVES_TZ 1) @@ -295,7 +301,6 @@ ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) SET (LINUX_LFS 0) SET (HDF5_EXTRA_FLAGS) -#IF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") IF (NOT WINDOWS) # Linux Specific flags SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE) @@ -331,7 +336,6 @@ IF (NOT WINDOWS) ENDIF (HDF5_ENABLE_LARGE_FILE) SET (CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${HDF5_EXTRA_FLAGS}) ENDIF (NOT WINDOWS) -#ENDIF (CMAKE_SYSTEM MATCHES "Linux-([3-9]\\.[0-9]|2\\.[4-9])\\.") ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) @@ -632,7 +636,8 @@ ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- -IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) +IF (WINDOWS) + IF (NOT HDF5_NO_IOEO_TEST) MESSAGE (STATUS "Checking for InitOnceExecuteOnce:") IF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") IF (LARGEFILE) @@ -690,7 +695,8 @@ IF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) "Return value: ${HAVE_IOEO_EXITCODE}\n") ENDIF("${HAVE_IOEO_EXITCODE}" EQUAL 0) ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") -ENDIF (WINDOWS AND NOT HDF5_NO_IOEO_TEST) + ENDIF (NOT HDF5_NO_IOEO_TEST) +ENDIF (WINDOWS) #----------------------------------------------------------------------------- diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index b2567b5..80406a3 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -6,6 +6,9 @@ /* Define if the Windows virtual file driver should be compiled */ #cmakedefine H5_HAVE_WINDOWS @H5_HAVE_WINDOWS@ +/* Define if using MinGW */ +#cmakedefine H5_HAVE_MINGW @H5_HAVE_MINGW@ + /* Define if on the Windows platform and default WIN32 API */ #cmakedefine H5_HAVE_WIN32_API @H5_HAVE_WIN32_API@ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index b67e01e..49e1957 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -44,6 +44,10 @@ #endif #ifdef H5_HAVE_WIN32_API +/* The following two defines must be before any windows headers are included */ +#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ +#define NOGDI /* Exclude Graphic Display Interface macros */ + #include #include @@ -115,10 +119,12 @@ typedef struct H5FD_stdio_t { /* Use similar structure as in H5private.h by defining Windows stuff first. */ #ifdef H5_HAVE_WIN32_API + #ifndef H5_HAVE_MINGW # define file_fseek _fseeki64 # define file_offset_t __int64 # define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ # define file_ftell _ftelli64 + #endif #endif /* Use file_xxx to indicate these are local macros, avoiding confusing diff --git a/src/H5win32defs.h b/src/H5win32defs.h index 5f886d1..e9b87625 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -33,9 +33,7 @@ typedef __int64 h5_stat_size_t; #define HDdup(F) _dup(F) #define HDfdopen(N,S) _fdopen(N,S) #define HDfileno(F) _fileno(F) -#define HDfseek(F,O,W) _fseeki64(F,O,W) #define HDfstat(F,B) _fstati64(F,B) -#define HDftruncate(F,L) _chsize_s(F,L) #define HDisatty(F) _isatty(F) #define HDgetcwd(S,Z) _getcwd(S,Z) #define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z) @@ -91,4 +89,8 @@ struct timezone { * type cannot be cast as a ulong like other systems. */ #define HDpthread_self_ulong() ((unsigned long)GetCurrentThreadId()) +#ifndef H5_HAVE_MINGW +#define HDftruncate(F,L) _chsize_s(F,L) +#define HDfseek(F,O,W) _fseeki64(F,O,W) +#endif #endif /* H5_HAVE_WIN32_API */ -- cgit v0.12 From 6cef6bca1f058a2a39c7c75680096ce32be2a504 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 28 Mar 2012 17:09:38 -0500 Subject: [svn-r22176] Purpose: Fix for HDFFV-7644 GMQS: h5diff - incorrect behaviors when comparing HDF5 files with different type of objects (dataset, group, type) as common objects Description: Fixed failure for comparing same named object with different object types in comparing groups. (common object comparison) Prior to the fix, h5diff resulted in error. After the fix, h5diff detects such case as non-comparable and display messages accordingly. Test cases were added and tagged with jira#. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- MANIFEST | 2 + release_docs/RELEASE.txt | 4 + tools/h5diff/CMakeLists.txt | 12 + tools/h5diff/h5diffgentest.c | 163 ++++++++++++- tools/h5diff/testfiles/h5diff_20.txt | 2 +- tools/h5diff/testfiles/h5diff_21.txt | 2 +- tools/h5diff/testfiles/h5diff_22.txt | 2 +- tools/h5diff/testfiles/h5diff_222.txt | 3 + tools/h5diff/testfiles/h5diff_223.txt | 4 + tools/h5diff/testfiles/h5diff_224.txt | 4 + tools/h5diff/testfiles/h5diff_505.txt | 2 +- tools/h5diff/testfiles/h5diff_507.txt | 2 +- tools/h5diff/testfiles/h5diff_509.txt | 2 +- tools/h5diff/testfiles/h5diff_515.txt | 7 +- tools/h5diff/testfiles/h5diff_517.txt | 7 +- tools/h5diff/testfiles/non_comparables1.h5 | Bin 6568 -> 8628 bytes tools/h5diff/testfiles/non_comparables2.h5 | Bin 6584 -> 8644 bytes tools/h5diff/testh5diff.sh | 8 + tools/lib/h5diff.c | 376 ++++++++--------------------- tools/lib/h5diff.h | 2 +- 20 files changed, 313 insertions(+), 291 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_223.txt create mode 100644 tools/h5diff/testfiles/h5diff_224.txt diff --git a/MANIFEST b/MANIFEST index fe3a612..b1c207d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1815,6 +1815,8 @@ ./tools/h5diff/testfiles/h5diff_220.txt ./tools/h5diff/testfiles/h5diff_221.txt ./tools/h5diff/testfiles/h5diff_222.txt +./tools/h5diff/testfiles/h5diff_223.txt +./tools/h5diff/testfiles/h5diff_224.txt ./tools/h5diff/testfiles/h5diff_300.txt ./tools/h5diff/testfiles/h5diff_400.txt ./tools/h5diff/testfiles/h5diff_401.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e2ab4ce..a4633b0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -691,6 +691,10 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: Fixed failure for comparing same named object with different + object types in comparing groups. Prior to the fix, h5diff resulted + in error. After the fix, h5diff detects such case as non-comparable + and display messages accordingly. HDFFV-7664 (JKM 2012/03/28) - h5diff: If unique objects exists only in one file and try to exclude the unique objects with --exclude-path option, h5diff missed excluding some objects. diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index dfd1800..da2aaf9 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -84,6 +84,8 @@ IF (BUILD_TESTING) h5diff_220.txt h5diff_221.txt h5diff_222.txt + h5diff_223.txt + h5diff_224.txt h5diff_21.txt h5diff_22.txt h5diff_23.txt @@ -577,6 +579,10 @@ IF (BUILD_TESTING) h5diff_221.out.err h5diff_222.out h5diff_222.out.err + h5diff_223.out + h5diff_223.out.err + h5diff_224.out + h5diff_224.out.err h5diff_21.out h5diff_21.out.err h5diff_22.out @@ -1164,6 +1170,12 @@ ADD_H5_TEST (h5diff_221 1 -c non_comparables1.h5 non_comparables2.h5 /g2) # All the rest comparables should display differences ADD_H5_TEST (h5diff_222 1 -c non_comparables1.h5 non_comparables2.h5) +# non-comparable test for common objects (same name) with different object types +# (HDFFV-7644) +ADD_H5_TEST (h5diff_223 0 -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes) +# swap files +ADD_H5_TEST (h5diff_224 0 -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes) + # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links # ############################################################################## diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index b57c98a..0b8b4cf 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -155,7 +155,8 @@ static void test_comps_array (const char *fname, const char *dset, const char *a static void test_comps_vlen (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); static void test_comps_array_vlen (const char *fname, const char *dset, const char *attr, int diff, int is_file_new); static void test_comps_vlen_arry (const char *fname, const char *dset,const char *attr, int diff, int is_file_new); -static void test_non_comparables (const char *fname, int diff); +static void test_data_nocomparables (const char *fname, int diff); +static void test_objs_nocomparables (const char *fname1, const char *fname2); /* called by test_attributes() and test_datasets() */ static void write_attr_in(hid_t loc_id,const char* dset_name,hid_t fid,int make_diffs); @@ -250,8 +251,11 @@ int main(void) * comparable datasets and attributes. All the comparables should display * differences. */ - test_non_comparables(NON_COMPARBLES1,0); - test_non_comparables(NON_COMPARBLES2,5); + test_data_nocomparables(NON_COMPARBLES1,0); + test_data_nocomparables(NON_COMPARBLES2,5); + + /* common objects (same name) with different object types. HDFFV-7644 */ + test_objs_nocomparables(NON_COMPARBLES1, NON_COMPARBLES2); return 0; } @@ -4787,7 +4791,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch /*------------------------------------------------------------------------- -* Function: test_non_comparables +* Function: test_data_nocomparables * * Purpose: * Create test files with non-comparable dataset and attributes with @@ -4796,7 +4800,7 @@ static void test_comps_vlen_arry (const char * fname, const char *dset, const ch * *-------------------------------------------------------------------------*/ #define DIM_ARRY 3 -static void test_non_comparables (const char * fname, int make_diffs) +static void test_data_nocomparables (const char * fname, int make_diffs) { hid_t fid=0; hid_t gid1=0; @@ -4998,6 +5002,155 @@ out: } /*------------------------------------------------------------------------- +* Function: test_objs_nocomparables +* +* Purpose: +* Create test files with common objects (same name) but different object +* types. +* h5diff should show non-comparable output from these common objects. +*-------------------------------------------------------------------------*/ +static void test_objs_nocomparables(const char *fname1, const char *fname2) +{ + herr_t status = SUCCEED; + hid_t fid1=0; + hid_t fid2=0; + hid_t topgid1=0; + hid_t topgid2=0; + hid_t gid1=0; + hid_t did1=0; + hid_t tid1=0; + hid_t gid2=0; + hid_t did2=0; + hid_t tid2=0; + hsize_t dims[1] = {DIM_ARRY}; + int data1[DIM_ARRY] = {1,1,1}; + int data2[DIM_ARRY] = {2,2,2}; + + /*----------------------------------------------------------------------- + * Open file(s) to add objects + *------------------------------------------------------------------------*/ + /* file1 */ + fid1 = H5Fopen (fname1, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid1 < 0) + { + fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); + status = FAIL; + goto out; + } + + /* file2 */ + fid2 = H5Fopen (fname2, H5F_ACC_RDWR, H5P_DEFAULT); + if (fid2 < 0) + { + fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname2); + status = FAIL; + goto out; + } + + /*----------------------------------------------------------------------- + * in file1 : add member objects + *------------------------------------------------------------------------*/ + /* parent group */ + topgid1 = H5Gcreate2(fid1, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (topgid1 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + status = FAIL; + goto out; + } + + /* dataset */ + status = write_dset(topgid1, 1, dims,"obj1", H5T_NATIVE_INT, data1); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + goto out; + } + + /* group */ + gid1 = H5Gcreate2(topgid1, "obj2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid1 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + status = FAIL; + goto out; + } + + /* committed type */ + tid1 = H5Tcopy(H5T_NATIVE_INT); + status = H5Tcommit2(topgid1, "obj3", tid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); + goto out; + } + + /*----------------------------------------------------------------------- + * in file2 : add member objects + *------------------------------------------------------------------------*/ + /* parent group */ + topgid2 = H5Gcreate2(fid2, "diffobjtypes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (topgid2 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + status = FAIL; + goto out; + } + + /* group */ + gid2 = H5Gcreate2(topgid2, "obj1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (gid2 < 0) + { + fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + status = FAIL; + goto out; + } + + /* committed type */ + tid2 = H5Tcopy(H5T_NATIVE_INT); + status = H5Tcommit2(topgid2, "obj2", tid2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); + goto out; + } + + /* dataset */ + status = write_dset(topgid2, 1, dims,"obj3", H5T_NATIVE_INT, data2); + if (status == FAIL) + { + fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + goto out; + } + +out: + /*----------------------------------------------------------------------- + * Close IDs + *-----------------------------------------------------------------------*/ + if(fid1) + H5Fclose(fid1); + if(fid2) + H5Fclose(fid2); + if(topgid1) + H5Gclose(topgid1); + if(topgid2) + H5Gclose(topgid2); + if(did1) + H5Dclose(did1); + if(did2) + H5Dclose(did2); + if(gid1) + H5Gclose(gid1); + if(gid2) + H5Gclose(gid2); + if(tid1) + H5Tclose(tid1); + if(tid2) + H5Tclose(tid2); + +} + +/*------------------------------------------------------------------------- * Function: write_attr_in * * Purpose: write attributes in LOC_ID (dataset, group, named datatype) diff --git a/tools/h5diff/testfiles/h5diff_20.txt b/tools/h5diff/testfiles/h5diff_20.txt index 3edb543..09c20cb 100644 --- a/tools/h5diff/testfiles/h5diff_20.txt +++ b/tools/h5diff/testfiles/h5diff_20.txt @@ -1,4 +1,4 @@ - is of type H5G_DATASET and is of type H5G_GROUP +Not comparable: is of type H5G_DATASET and is of type H5G_GROUP -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_21.txt b/tools/h5diff/testfiles/h5diff_21.txt index 1479457..1c625fe 100644 --- a/tools/h5diff/testfiles/h5diff_21.txt +++ b/tools/h5diff/testfiles/h5diff_21.txt @@ -1,4 +1,4 @@ - is of type H5G_DATASET and is of type H5G_LINK +Not comparable: is of type H5G_DATASET and is of type H5G_LINK -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_22.txt b/tools/h5diff/testfiles/h5diff_22.txt index 3ccb06b..2ef22d0 100644 --- a/tools/h5diff/testfiles/h5diff_22.txt +++ b/tools/h5diff/testfiles/h5diff_22.txt @@ -1,4 +1,4 @@ - is of type H5G_DATASET and is of type H5G_TYPE +Not comparable: is of type H5G_DATASET and is of type H5G_TYPE -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_222.txt b/tools/h5diff/testfiles/h5diff_222.txt index bdecb8a..53c9464 100644 --- a/tools/h5diff/testfiles/h5diff_222.txt +++ b/tools/h5diff/testfiles/h5diff_222.txt @@ -1,3 +1,6 @@ +Not comparable: is of type H5G_DATASET and is of type H5G_GROUP +Not comparable: is of type H5G_GROUP and is of type H5G_TYPE +Not comparable: is of type H5G_TYPE and is of type H5G_DATASET Not comparable: is of class H5T_INTEGER and is of class H5T_STRING attribute: > and > 3 differences found diff --git a/tools/h5diff/testfiles/h5diff_223.txt b/tools/h5diff/testfiles/h5diff_223.txt new file mode 100644 index 0000000..c8e0f65 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_223.txt @@ -0,0 +1,4 @@ +Not comparable: is of type H5G_DATASET and is of type H5G_GROUP +Not comparable: is of type H5G_GROUP and is of type H5G_TYPE +Not comparable: is of type H5G_TYPE and is of type H5G_DATASET +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_224.txt b/tools/h5diff/testfiles/h5diff_224.txt new file mode 100644 index 0000000..a4ebedb --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_224.txt @@ -0,0 +1,4 @@ +Not comparable: is of type H5G_GROUP and is of type H5G_DATASET +Not comparable: is of type H5G_TYPE and is of type H5G_GROUP +Not comparable: is of type H5G_DATASET and is of type H5G_TYPE +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_505.txt b/tools/h5diff/testfiles/h5diff_505.txt index a220730..607b99b 100644 --- a/tools/h5diff/testfiles/h5diff_505.txt +++ b/tools/h5diff/testfiles/h5diff_505.txt @@ -1,4 +1,4 @@ - is of type H5G_GROUP and is of type H5G_LINK +Not comparable: is of type H5G_GROUP and is of type H5G_LINK -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_507.txt b/tools/h5diff/testfiles/h5diff_507.txt index 6176f3f..06b7fe6 100644 --- a/tools/h5diff/testfiles/h5diff_507.txt +++ b/tools/h5diff/testfiles/h5diff_507.txt @@ -1,4 +1,4 @@ - is of type H5G_GROUP and is of type H5G_UDLINK +Not comparable: is of type H5G_GROUP and is of type H5G_UDLINK -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_509.txt b/tools/h5diff/testfiles/h5diff_509.txt index a51ab35..2e3e87a 100644 --- a/tools/h5diff/testfiles/h5diff_509.txt +++ b/tools/h5diff/testfiles/h5diff_509.txt @@ -1,4 +1,4 @@ - is of type H5G_LINK and is of type H5G_UDLINK +Not comparable: is of type H5G_LINK and is of type H5G_UDLINK -------------------------------- Some objects are not comparable -------------------------------- diff --git a/tools/h5diff/testfiles/h5diff_515.txt b/tools/h5diff/testfiles/h5diff_515.txt index 077d463..263441d 100644 --- a/tools/h5diff/testfiles/h5diff_515.txt +++ b/tools/h5diff/testfiles/h5diff_515.txt @@ -17,8 +17,11 @@ dataset: and 0 differences found group : and 0 differences found -group : and -0 differences found +Not comparable: is of type H5G_GROUP and is of type H5G_UDLINK link : and 0 differences found +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_517.txt b/tools/h5diff/testfiles/h5diff_517.txt index 1b6e24f..91c69fb 100644 --- a/tools/h5diff/testfiles/h5diff_517.txt +++ b/tools/h5diff/testfiles/h5diff_517.txt @@ -10,6 +10,9 @@ group1 group2 group : and 0 differences found -group : and -0 differences found +Not comparable: is of type H5G_GROUP and is of type H5G_UDLINK +-------------------------------- +Some objects are not comparable +-------------------------------- +Use -c for a list of objects without details of differences. EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/non_comparables1.h5 b/tools/h5diff/testfiles/non_comparables1.h5 index 71b65c8..7dbb45d 100644 Binary files a/tools/h5diff/testfiles/non_comparables1.h5 and b/tools/h5diff/testfiles/non_comparables1.h5 differ diff --git a/tools/h5diff/testfiles/non_comparables2.h5 b/tools/h5diff/testfiles/non_comparables2.h5 index 188ceb9..a5e7014 100644 Binary files a/tools/h5diff/testfiles/non_comparables2.h5 and b/tools/h5diff/testfiles/non_comparables2.h5 differ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 3eb3306..dfea6f7 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -156,6 +156,8 @@ $SRC_H5DIFF_TESTFILES/h5diff_208.txt $SRC_H5DIFF_TESTFILES/h5diff_220.txt $SRC_H5DIFF_TESTFILES/h5diff_221.txt $SRC_H5DIFF_TESTFILES/h5diff_222.txt +$SRC_H5DIFF_TESTFILES/h5diff_223.txt +$SRC_H5DIFF_TESTFILES/h5diff_224.txt $SRC_H5DIFF_TESTFILES/h5diff_21.txt $SRC_H5DIFF_TESTFILES/h5diff_22.txt $SRC_H5DIFF_TESTFILES/h5diff_23.txt @@ -827,6 +829,12 @@ if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then else TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 fi + +# non-comparable test for common objects (same name) with different object types +# (HDFFV-7644) +TOOLTEST h5diff_223.txt -c non_comparables1.h5 non_comparables2.h5 /diffobjtypes +# swap files +TOOLTEST h5diff_224.txt -c non_comparables2.h5 non_comparables1.h5 /diffobjtypes # ############################################################################## # # Links compare without --follow-symlinks nor --no-dangling-links diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index cef30dd..306f914 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -1121,6 +1121,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, char * obj2_fullpath = NULL; h5trav_type_t objtype; diff_args_t argdata; + size_t idx1 = 0; + size_t idx2 = 0; /* @@ -1160,17 +1162,6 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, } } - /* objects with the same name but different HDF5 types */ - for( i = 0; i < table->nobjs; i++) - { - if ( table->objs[i].flags[0] && table->objs[i].flags[1] ) - { - if ( table->objs[i].type != table->objs[i].type ) - { - options->contents = 0; - } - } - } /*------------------------------------------------------------------------- * do the diff for common objects @@ -1205,8 +1196,18 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDstrcpy(obj2_fullpath, grp2_path); HDstrcat(obj2_fullpath, table->objs[i].name); + /* get index to figure out type of the object in file1 */ + while ( info1->paths[idx1].path && + (HDstrcmp (obj1_fullpath, info1->paths[idx1].path) != 0) ) + idx1++; + /* get index to figure out type of the object in file2 */ + while ( info2->paths[idx2].path && + (HDstrcmp (obj2_fullpath, info2->paths[idx2].path) != 0) ) + idx2++; + /* Set argdata to pass other args into diff() */ - argdata.type = objtype; + argdata.type[0] = info1->paths[idx1].type; + argdata.type[1] = info2->paths[idx2].type; argdata.is_same_trgobj = table->objs[i].is_same_trgobj; options->cmn_objs = 1; @@ -1242,7 +1243,8 @@ hsize_t diff_match(hid_t file1_id, const char *grp1, trav_info_t *info1, HDstrcpy(args.name1, obj1_fullpath); HDstrcpy(args.name2, obj2_fullpath); args.options = *options; - args.argdata.type = objtype; + args.argdata.type[0] = info1->paths[idx1].type; + args.argdata.type[1] = info2->paths[idx2].type; args.argdata.is_same_trgobj = table->objs[i].is_same_trgobj; h5diffdebug2("busyTasks=%d\n", busyTasks); @@ -1576,176 +1578,9 @@ hsize_t diff_compare(hid_t file1_id, obj1type = info1->paths[i].type; obj2type = info2->paths[j].type; - /*----------------------------------------------------------------- - * follow link option, compare with target object - */ - if (options->follow_links) - { - /* pass how to handle printing warning to linkinfo option */ - if(print_warn(options)) - linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; - - /*------------------------------------------------------------ - * Soft links - *------------------------------------------------------------*/ - - /*-------------------------- - * if object1 soft link */ - if (obj1type == H5TRAV_TYPE_LINK) - { - /* get type of target object */ - l_ret = H5tools_get_symlink_info(file1_id, obj1name, &linkinfo1, TRUE); - /* dangling link */ - if (l_ret == 0) - { - if (options->no_dangle_links) - { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", obj1name); - options->err_stat = 1; - goto out; - } - else - is_dangle_link1 = 1; - } - /* fail */ - else if(l_ret < 0) - { - options->err_stat = 1; - goto out; - } - else /* OK */ - { - /* target type for diff() */ - obj1type = linkinfo1.trg_type; - } - } - - /*----------------------------- - * if object2 is soft link */ - if (obj2type == H5TRAV_TYPE_LINK) - { - /* get type target object */ - l_ret = H5tools_get_symlink_info(file2_id, obj2name, &linkinfo2, TRUE); - /* dangling link */ - if (l_ret == 0) - { - if (options->no_dangle_links) - { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", obj2name); - options->err_stat = 1; - goto out; - } - else - is_dangle_link2=1; - } - /* fail */ - else if(l_ret < 0) - { - options->err_stat = 1; - goto out; - } - else /* OK */ - { - /* target type for diff() */ - obj2type = linkinfo2.trg_type; - } - } - - /*------------------------------------------------------------ - * External links - *------------------------------------------------------------*/ - - /*-------------------------------- - * if object1 is external link */ - if (obj1type == H5TRAV_TYPE_UDLINK) - { - /* get type and name of target object */ - l_ret = H5tools_get_symlink_info(file1_id, obj1name, &linkinfo1, TRUE); - /* dangling link */ - if (l_ret == 0) - { - if (options->no_dangle_links) - { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", obj1name); - options->err_stat = 1; - goto out; - } - else - is_dangle_link1 = 1; - } - /* fail */ - else if(l_ret < 0) - { - options->err_stat = 1; - goto out; - } - else /* OK */ - { - /* for external link */ - if(linkinfo1.linfo.type == H5L_TYPE_EXTERNAL) - obj1type = linkinfo1.trg_type; - } - } - - /*-------------------------------- - * if object2 is external link */ - if (obj2type == H5TRAV_TYPE_UDLINK) - { - /* get type and name of target object */ - l_ret = H5tools_get_symlink_info(file2_id, obj2name, &linkinfo2, TRUE); - /* dangling link */ - if (l_ret == 0) - { - if (options->no_dangle_links) - { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", obj2name); - options->err_stat = 1; - goto out; - } - else - is_dangle_link2 = 1; - } - /* fail */ - else if(l_ret < 0) - { - options->err_stat = 1; - goto out; - } - else /* OK */ - { - /* for external link */ - if(linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) - obj2type = linkinfo2.trg_type; - } - } - /* found dangling link */ - if (is_dangle_link1 || is_dangle_link2) - goto out; - } /* end of follow_links */ - - /* objects are not the same type */ - if (obj1type != obj2type) - { - if (options->m_verbose||options->m_list_not_cmp) - { - parallel_print("<%s> is of type %s and <%s> is of type %s\n", - obj1name, get_type(obj1type), - obj2name, get_type(obj2type)); - } - options->not_cmp=1; - goto out; - } - /* Set argdata to pass other args into diff() */ - argdata.type = obj1type; + argdata.type[0] = obj1type; + argdata.type[1] = obj2type; argdata.is_same_trgobj = 0; nfound = diff(file1_id, obj1name, @@ -1806,7 +1641,8 @@ out: * Return: Number of differences found * * Programmer: Jonathan Kim - * - add following links feature (Feb 11,2010) + * - Move follow symlinks code toward top. (March 2812) + * - Add following symlinks feature (Feb 11,2010) * - Change to use diff_args_t to pass the rest of args. * Passing through it instead of individual args provides smoother * extensibility through its members along with MPI code update for ph5diff @@ -1834,6 +1670,7 @@ hsize_t diff(hid_t file1_id, int is_dangle_link2 = 0; int is_hard_link = 0; hsize_t nfound = 0; + h5trav_type_t object_type; /* to get link info */ @@ -1848,52 +1685,86 @@ hsize_t diff(hid_t file1_id, if(print_warn(options)) linkinfo1.opt.msg_mode = linkinfo2.opt.msg_mode = 1; - /* - * Get target object info for obj1 and obj2 and check dangling links. - * (for hard-linked-objects, because diff() only get the obj1's type, - * so obj2's type should be check here when diff() is called from - * diff_match() for same-named objects with dangling link only one side.) - */ - - /* target object1 - get type and name */ - ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, TRUE); - /* dangling link */ - if (ret == 0) + /* for symbolic links, take care follow symlink and no dangling link + * options */ + if (argdata->type[0] == H5TRAV_TYPE_LINK || + argdata->type[0] == H5TRAV_TYPE_UDLINK || + argdata->type[1] == H5TRAV_TYPE_LINK || + argdata->type[1] == H5TRAV_TYPE_UDLINK ) { - if (options->no_dangle_links) + /* + * check dangling links for path1 and path2 + */ + + /* target object1 - get type and name */ + ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, TRUE); + /* dangling link */ + if (ret == 0) { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", path1); - goto out; + if (options->no_dangle_links) + { + /* gangling link is error */ + if(options->m_verbose) + parallel_print("Warning: <%s> is a dangling link.\n", path1); + goto out; + } + else + is_dangle_link1 = 1; } - else - is_dangle_link1 = 1; - } - else if (ret < 0) - goto out; + else if (ret < 0) + goto out; - /* target object2 - get type and name */ - ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, TRUE); - /* dangling link */ - if (ret == 0) - { - if (options->no_dangle_links) + /* target object2 - get type and name */ + ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, TRUE); + /* dangling link */ + if (ret == 0) { - /* gangling link is error */ - if(options->m_verbose) - parallel_print("Warning: <%s> is a dangling link.\n", path2); + if (options->no_dangle_links) + { + /* gangling link is error */ + if(options->m_verbose) + parallel_print("Warning: <%s> is a dangling link.\n", path2); + goto out; + } + else + is_dangle_link2 = 1; + } + else if (ret < 0) goto out; + + /* found dangling link */ + if (is_dangle_link1 || is_dangle_link2) + goto out2; + + /* follow symbolic link option */ + if (options->follow_links) + { + if (linkinfo1.linfo.type == H5L_TYPE_SOFT || + linkinfo1.linfo.type == H5L_TYPE_EXTERNAL) + argdata->type[0] = linkinfo1.trg_type; + + if (linkinfo2.linfo.type == H5L_TYPE_SOFT || + linkinfo2.linfo.type == H5L_TYPE_EXTERNAL) + argdata->type[1] = linkinfo2.trg_type; } - else - is_dangle_link2 = 1; } - else if (ret < 0) - goto out; - - /* found dangling link */ - if (is_dangle_link1 || is_dangle_link2) + /* if objects are not the same type */ + if (argdata->type[0] != argdata->type[1]) + { + if (options->m_verbose||options->m_list_not_cmp) + { + parallel_print("Not comparable: <%s> is of type %s and <%s> is of type %s\n", + path1, get_type(argdata->type[0]), + path2, get_type(argdata->type[1])); + } + options->not_cmp=1; + /* TODO: will need to update non-comparable is different + * options->contents = 0; + */ goto out2; + } + else /* now both object types are same */ + object_type = argdata->type[0]; /* * If both points to the same target object, skip comparing details inside @@ -1903,17 +1774,17 @@ hsize_t diff(hid_t file1_id, * * Perform this to match the outputs as bypassing. */ - is_hard_link = (argdata->type == H5TRAV_TYPE_DATASET || - argdata->type == H5TRAV_TYPE_NAMED_DATATYPE || - argdata->type == H5TRAV_TYPE_GROUP); - if (options->follow_links || is_hard_link) + if (argdata->is_same_trgobj) { - if (argdata->is_same_trgobj) + is_hard_link = (object_type == H5TRAV_TYPE_DATASET || + object_type == H5TRAV_TYPE_NAMED_DATATYPE || + object_type == H5TRAV_TYPE_GROUP); + if (options->follow_links || is_hard_link) { /* print information is only verbose option is used */ if(options->m_verbose || options->m_report) { - switch(argdata->type) + switch(object_type) { case H5TRAV_TYPE_DATASET: do_print_objname("dataset", path1, path2, options); @@ -1935,7 +1806,7 @@ hsize_t diff(hid_t file1_id, break; default: parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", - path1, path2, get_type(argdata->type) ); + path1, path2, get_type(object_type) ); options->not_cmp = 1; break; } /* switch(type)*/ @@ -1943,11 +1814,12 @@ hsize_t diff(hid_t file1_id, print_found(nfound); } /* if(options->m_verbose || options->m_report) */ + /* exact same, so comparison is done */ goto out2; } } - switch(argdata->type) + switch(object_type) { /*---------------------------------------------------------------------- * H5TRAV_TYPE_DATASET @@ -2064,30 +1936,6 @@ hsize_t diff(hid_t file1_id, if(print_objname(options, nfound)) do_print_objname("link", path1, path2, options); - if (options->follow_links) - { - /* objects are not the same type */ - if (linkinfo1.trg_type != linkinfo2.trg_type) - { - if (options->m_verbose||options->m_list_not_cmp) - { - parallel_print("<%s> is of type %s and <%s> is of type %s\n", path1, get_type(linkinfo1.trg_type), path2, get_type(linkinfo2.trg_type)); - } - options->not_cmp=1; - goto out; - } - - /* Renew type in argdata to pass into diff(). - * For recursive call, argdata.is_same_trgobj is already - * set from initial call, so don't reset here */ - argdata->type = linkinfo1.trg_type; - - /* call self to compare target object */ - nfound += diff(file1_id, path1, - file2_id, path2, - options, argdata); - } - /* always print the number of differences found in verbose mode */ if(options->m_verbose) print_found(nfound); @@ -2121,28 +1969,6 @@ hsize_t diff(hid_t file1_id, if(print_objname(options, nfound)) do_print_objname("external link", path1, path2, options); - if (options->follow_links) - { - /* objects are not the same type */ - if (linkinfo1.trg_type != linkinfo2.trg_type) - { - if (options->m_verbose||options->m_list_not_cmp) - { - parallel_print("<%s> is of type %s and <%s> is of type %s\n", path1, get_type(linkinfo1.trg_type), path2, get_type(linkinfo2.trg_type)); - } - options->not_cmp=1; - goto out; - } - - /* Renew type in argdata to pass into diff(). - * For recursive call, argdata.is_same_trgobj is already - * set from initial call, so don't reset here */ - argdata->type = linkinfo1.trg_type; - - nfound = diff(file1_id, path1, - file2_id, path2, - options, argdata); - } } /* end if */ else { @@ -2172,7 +1998,7 @@ hsize_t diff(hid_t file1_id, default: if(options->m_verbose) parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", - path1, path2, get_type(argdata->type) ); + path1, path2, get_type(object_type) ); options->not_cmp = 1; break; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 1ff4402..6985b68 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -28,7 +28,7 @@ * as it doesn't require interface change. *------------------------------------------------------------------------*/ typedef struct { - h5trav_type_t type; + h5trav_type_t type[2]; hbool_t is_same_trgobj; } diff_args_t; /*------------------------------------------------------------------------- -- cgit v0.12 From e13eb463e03e978a203f77cbaf8bc504e05b28f3 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 28 Mar 2012 18:03:17 -0500 Subject: [svn-r22178] Fixed a bad merge where truncate was called twice in the core VFD. Minor change: tested on jam, koala, ostrich and 64-bit Windows 7 with the core VFD set. --- src/H5FDcore.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 940d4c7..ff99cab 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -1147,20 +1147,10 @@ if(file->eof < new_eof) * re-extended later. This may happen on Open VMS. */ if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#endif - if(-1 == HDftruncate(file->fd, (HDoff_t)file->eoa)) +#endif /* H5_VMS */ + if(-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ - -#ifdef H5_VMS - /* Reset seek offset to the beginning of the file, so that the file isn't - * re-extended later. This may happen on Open VMS. */ - if(-1 == HDlseek(file->fd, 0, SEEK_SET)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") -#endif - - if(-1 == HDftruncate(file->fd, (off_t)new_eof)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") } /* end if */ /* Update the eof value */ -- cgit v0.12 From a3dcbef52b3cd8407ac57f148ded89eb2f4fdecb Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 29 Mar 2012 05:49:38 -0500 Subject: [svn-r22180] Description: Add new "metadata block size" command line option ('-M ' or '--metadata_block_size=') for h5repack. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug) (h5committest upcoming) --- tools/h5repack/h5repack.c | 6 +- tools/h5repack/h5repack.h | 1 + tools/h5repack/h5repack.sh.in | 5 +- tools/h5repack/h5repack_copy.c | 152 ++++++++++++++++++----------------------- tools/h5repack/h5repack_main.c | 34 +++------ tools/h5repack/h5repacktst.c | 32 +++++++-- 6 files changed, 110 insertions(+), 120 deletions(-) diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 28d66c5..9778fdd 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -87,10 +87,12 @@ int h5repack(const char* infile, */ int -h5repack_init(pack_opt_t *options, int verbose, H5F_file_space_type_t strategy, hsize_t threshold) +h5repack_init(pack_opt_t *options, int verbose, H5F_file_space_type_t strategy, + hsize_t threshold) { int k, n; - HDmemset(options,0,sizeof(pack_opt_t)); + + HDmemset(options, 0, sizeof(pack_opt_t)); options->min_comp = 1024; options->verbose = verbose; diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index 6415d3a..3907178 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -111,6 +111,7 @@ typedef struct { datatype, fill value, filter pipleline, attribute */ const char *ublock_filename; /* user block file name */ hsize_t ublock_size; /* user block size */ + hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */ hsize_t threshold; /* alignment threshold for H5Pset_alignment */ hsize_t alignment ; /* alignment for H5Pset_alignment */ H5F_file_space_type_t fs_strategy; /* File space handling strategy */ diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index c1cbba1..2271f34 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -801,7 +801,6 @@ TOOLTEST h5repack_refs.h5 # the references in attribute of compund or vlen datatype TOOLTEST h5repack_attr_refs.h5 - # Add test for memory leak in attirbute. This test is verified by CTEST. # 1. leak from vlen string # 2. leak from compound type without reference member @@ -809,6 +808,10 @@ TOOLTEST h5repack_attr_refs.h5 # Note: this test is experimental for sharing test file among tools TOOLTEST h5diff_attr1.h5 +# tests for metadata block size option ('-M') +TOOLTEST h5diff_layout.h5 -M 8192 +TOOLTEST h5diff_layout.h5 --metadata_block_size=8192 + if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." exit $EXIT_SUCCESS diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 55cf932..15df639 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -132,23 +132,23 @@ int copy_objects(const char* fnamein, goto out; } - if(!options->fs_strategy) - { - if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) - { - error_msg("failed to retrieve file space strategy\n"); - goto out; - } - } - - if(!options->fs_threshold) - { - if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) - { - error_msg("failed to retrieve file space threshold\n"); - goto out; - } - } + if(!options->fs_strategy) + { + if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0) + { + error_msg("failed to retrieve file space strategy\n"); + goto out; + } + } + + if(!options->fs_threshold) + { + if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0) + { + error_msg("failed to retrieve file space threshold\n"); + goto out; + } + } if(H5Pclose(fcpl_in) < 0) { @@ -254,135 +254,113 @@ int copy_objects(const char* fnamein, } /* end if */ } /* end if */ } /* end if */ - - - - #if defined (H5REPACK_DEBUG_USER_BLOCK) - print_user_block(fnamein,fidin); + print_user_block(fnamein, fidin); #endif - /*------------------------------------------------------------------------- * set the new user userblock options in the FCPL (before H5Fcreate ) *------------------------------------------------------------------------- */ - if ( options->ublock_size > 0 ) { /* either use the FCPL already created or create a new one */ - if(fcpl != H5P_DEFAULT) + if(fcpl == H5P_DEFAULT) { - /* set user block size */ - if(H5Pset_userblock(fcpl, options->ublock_size) < 0) - { - error_msg("failed to set userblock size\n"); - goto out; - } - - } - - else - { - /* create a file creation property list */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { error_msg("fail to create a file creation property list\n"); goto out; } - - /* set user block size */ - if(H5Pset_userblock(fcpl, options->ublock_size) < 0) - { - error_msg("failed to set userblock size\n"); - goto out; - } - } - - + /* set user block size */ + if(H5Pset_userblock(fcpl, options->ublock_size) < 0) + { + error_msg("failed to set userblock size\n"); + goto out; + } } - /*------------------------------------------------------------------------- * set alignment options *------------------------------------------------------------------------- */ - - if ( options->alignment > 0 ) { /* either use the FAPL already created or create a new one */ - if (fapl != H5P_DEFAULT) + if (fapl == H5P_DEFAULT) { - - if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) + /* create a file access property list */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - error_msg("failed to set alignment\n"); + error_msg("Could not create file access property list\n"); goto out; } - } - else + if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { + error_msg("failed to set alignment\n"); + goto out; + } + } + /*------------------------------------------------------------------------- + * set metadata block size option + *------------------------------------------------------------------------- + */ + if ( options->meta_block_size > 0 ) + { + /* either use the FAPL already created or create a new one */ + if (fapl == H5P_DEFAULT) + { /* create a file access property list */ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg("Could not create file access property list\n"); goto out; } - - if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) - { - error_msg("failed to set alignment\n"); - goto out; - } - } + if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) + { + error_msg("failed to set metadata block size\n"); + goto out; + } } + /*------------------------------------------------------------------------- + * set free-space strategy options + *------------------------------------------------------------------------- + */ + /* either use the FCPL already created or create a new one */ - if(fcpl != H5P_DEFAULT) + if(fcpl == H5P_DEFAULT) { - /* set file space strategy and free space threshold */ - if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) - { - error_msg("failed to set file space strategy & threshold\n"); - goto out; - } + /* create a file creation property list */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + { + error_msg("fail to create a file creation property list\n"); + goto out; + } } - else + + /* set file space strategy and free space threshold */ + if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) { - /* create a file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - { - error_msg("fail to create a file creation property list\n"); - goto out; - } - - /* set file space strategy and free space threshold */ - if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0) - { - error_msg("failed to set file space strategy & threshold \n"); - goto out; - } + error_msg("failed to set file space strategy & threshold \n"); + goto out; } /*------------------------------------------------------------------------- * create the output file *------------------------------------------------------------------------- */ - - if(options->verbose) printf("Making file <%s>...\n",fnameout); - if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0) { error_msg("<%s>: Could not create file\n", fnameout ); diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index e1697ab..6004084 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -35,7 +35,7 @@ const char *outfile = NULL; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:t:a:i:o:S:T:"; +static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:T:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -51,6 +51,7 @@ static struct long_options l_opts[] = { { "ssize", require_arg, 's' }, { "ublock", require_arg, 'u' }, { "block", require_arg, 'b' }, + { "metadata_block_size", require_arg, 'M' }, { "threshold", require_arg, 't' }, { "alignment", require_arg, 'a' }, { "infile", require_arg, 'i' }, /* -i for backward compability */ @@ -78,24 +79,6 @@ static struct long_options l_opts[] = { * * Comments: * - * Modifications: - * July 2004: Introduced the extra EC or NN option for SZIP - * October 2006: Added a new switch -n, that allows to write the dataset - * using a native type. The default to write is the file type. - * - * Modification: - * Peter Cao, June 13, 2007 - * Add "-L, --latest" option to pack a file with the latest file format - * PVN, November 19, 2007 - * adopted the syntax h5repack [OPTIONS] file1 file2 - * PVN, November 28, 2007 - * added support for multiple global filters - * PVN, May 16, 2008 - * added backward compatibility for -i infile -o outfile - * PVN, August 20, 2008 - * add a user block to repacked file (switches -u -b) - * PVN, August 28, 2008 - * add options to set alignment (H5Pset_alignment) (switches -t -a) *------------------------------------------------------------------------- */ int main(int argc, const char **argv) @@ -115,7 +98,7 @@ int main(int argc, const char **argv) HDexit(EXIT_FAILURE); /* initialize options */ - h5repack_init(&options, 0, 0, (hsize_t)0); + h5repack_init(&options, 0, H5F_FILE_SPACE_DEFAULT, (hsize_t)0); parse_command_line(argc, argv, &options); @@ -187,6 +170,7 @@ static void usage(const char *prog) printf(" -e E, --file=E Name of file E with the -f and -l options\n"); printf(" -u U, --ublock=U Name of file U with user block data to be added\n"); printf(" -b B, --block=B Size of user block to be added\n"); + printf(" -M A, --metadata_block_size=A Metadata block size for H5Pset_meta_block_size\n"); printf(" -t T, --threshold=T Threshold value for H5Pset_alignment\n"); printf(" -a A, --alignment=A Alignment value for H5Pset_alignment\n"); printf(" -f FILT, --filter=FILT Filter type\n"); @@ -428,7 +412,6 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) break; - case 'u': options->ublock_filename = opt_arg; @@ -439,6 +422,11 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->ublock_size = (hsize_t)HDatol( opt_arg ); break; + case 'M': + + options->meta_block_size = (hsize_t)HDatol( opt_arg ); + break; + case 't': options->threshold = (hsize_t)HDatol( opt_arg ); @@ -455,7 +443,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) break; case 'S': - { + { char strategy[MAX_NC_NAME]; HDstrcpy(strategy, opt_arg); @@ -472,7 +460,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) HDexit(EXIT_FAILURE); } break; - } + } case 'T': diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 17a6190..5d72ce4 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -78,7 +78,6 @@ #define FNAME17OUT "h5repack_named_dtypes_out.h5" #define FNAME18 "h5repack_layout2.h5" -#define FNAME18OUT "h5repack_layout2_out.h5" #define FNAME_UB "ublock.bin" @@ -1561,6 +1560,25 @@ int main (void) PASSED(); /*------------------------------------------------------------------------- + * test --metadata_block_size option + *------------------------------------------------------------------------- + */ + TESTING(" metadata block size option"); + if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) + GOERROR; + pack_options.meta_block_size = 8192; + if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) + GOERROR; + if(h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) + GOERROR; + if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) + GOERROR; + if(h5repack_end(&pack_options) < 0) + GOERROR; + PASSED(); + + + /*------------------------------------------------------------------------- * clean temporary test files *------------------------------------------------------------------------- */ @@ -3253,7 +3271,7 @@ make_userblock(void) /* Initialize userblock data */ for(u = 0; u < USERBLOCK_SIZE; u++) - ub[u] = 'a' + (u % 26); + ub[u] = 'a' + (char)(u % 26); /* Re-open HDF5 file, as "plain" file */ if((fd = HDopen(FNAME16, O_WRONLY, 0644)) < 0) @@ -3366,7 +3384,7 @@ make_userblock_file(void) /* initialize userblock data */ for(u = 0; u < USERBLOCK_SIZE; u++) - ub[u] = 'a' + (u % 26); + ub[u] = 'a' + (char)(u % 26); /* open file */ if((fd = HDopen(FNAME_UB,O_WRONLY|O_CREAT|O_TRUNC, 0644 )) < 0) @@ -3842,7 +3860,7 @@ int write_dset_in(hid_t loc_id, int l; buf52[i][j].p = malloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) { if(make_diffs) @@ -4063,7 +4081,7 @@ int write_dset_in(hid_t loc_id, int l; buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].len = (size_t)(i + 1); for(l = 0; l < i + 1; l++) { if(make_diffs) @@ -4854,7 +4872,7 @@ int write_attr_in(hid_t loc_id, { int l; buf52[i][j].p = malloc((i + 1) * sizeof(int)); - buf52[i][j].len = i + 1; + buf52[i][j].len = (size_t)(i + 1); for (l = 0; l < i + 1; l++) if (make_diffs)((int *)buf52[i][j].p)[l] = 0; else ((int *)buf52[i][j].p)[l] = n++; @@ -5320,7 +5338,7 @@ int write_attr_in(hid_t loc_id, { int l; buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); - buf53[i][j][k].len = i + 1; + buf53[i][j][k].len = (size_t)i + 1; for (l = 0; l < i + 1; l++) if (make_diffs) { -- cgit v0.12 From 7ffa2b1bea6c4730ff47c9424e91e1b896d1afda Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 29 Mar 2012 08:46:16 -0500 Subject: [svn-r22181] Description: Correct typo in test file name. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug --- tools/h5repack/h5repack.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 2271f34..1654b0d 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -809,8 +809,8 @@ TOOLTEST h5repack_attr_refs.h5 TOOLTEST h5diff_attr1.h5 # tests for metadata block size option ('-M') -TOOLTEST h5diff_layout.h5 -M 8192 -TOOLTEST h5diff_layout.h5 --metadata_block_size=8192 +TOOLTEST h5repack_layout.h5 -M 8192 +TOOLTEST h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." -- cgit v0.12 From f05aa59a26cd8defa1cf52d42890cbe41a9f279e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 09:48:57 -0500 Subject: [svn-r22182] Update MINGW configuration --- config/cmake/HDFLibMacros.cmake | 63 +++++++++++++++++++++++++++-------------- 1 file changed, 42 insertions(+), 21 deletions(-) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 23c81da..6a66460 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -51,12 +51,19 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ADD_DEPENDENCIES (jpeg JPEG) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(jpeg PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -69,7 +76,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) SOVERSION "${JPEG_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES @@ -158,12 +165,19 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ADD_DEPENDENCIES (szip SZIP) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(szip PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -176,7 +190,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) SOVERSION "${SZIP_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES @@ -267,12 +281,19 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ADD_DEPENDENCIES (zlib ZLIB) IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) - SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - ) - ELSE (WIN32 AND NOT MINGW) + IF (WIN32) + IF (MINGW) + SET_TARGET_PROPERTIES(jpeg PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ELSE (MINGW) + SET_TARGET_PROPERTIES(zlib PROPERTIES + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + ) + ENDIF (MINGW) + ELSE (WIN32) IF (CYGWIN) SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" @@ -285,7 +306,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) SOVERSION "${ZLIB_VERSION_STRING}" ) ENDIF (CYGWIN) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES -- cgit v0.12 From 455c1256853698d83e12228c3967e981c3e8db75 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 10:29:06 -0500 Subject: [svn-r22183] Correct typo --- config/cmake/HDFLibMacros.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 6a66460..8bc571f 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -167,7 +167,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) IF (${libtype} MATCHES "SHARED") IF (WIN32) IF (MINGW) - SET_TARGET_PROPERTIES(jpeg PROPERTIES + SET_TARGET_PROPERTIES(szip PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) @@ -283,7 +283,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) IF (${libtype} MATCHES "SHARED") IF (WIN32) IF (MINGW) - SET_TARGET_PROPERTIES(jpeg PROPERTIES + SET_TARGET_PROPERTIES(zlib PROPERTIES IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) -- cgit v0.12 From 7d347f2afd39ea05ae775151d628276b01cb6dad Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 10:59:34 -0500 Subject: [svn-r22185] Update MINGW configuration to match HDFMacros settings for shared library --- config/cmake/HDFLibMacros.cmake | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index 8bc571f..dcf911b 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -54,8 +54,8 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) IF (WIN32) IF (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ELSE (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES @@ -168,8 +168,8 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) IF (WIN32) IF (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ELSE (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES @@ -284,8 +284,8 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) IF (WIN32) IF (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_SHARED_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}.lib" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ELSE (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES -- cgit v0.12 From 45a0d7e3f4d7ad2001e5699faf59a5f5a9843b32 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 12:51:56 -0500 Subject: [svn-r22190] Update MINGW configuration --- config/cmake/HDFMacros.cmake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 6a1ead7..0d3ab5f 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -35,29 +35,29 @@ ENDMACRO (IDE_SOURCE_PROPERTIES) #------------------------------------------------------------------------------- MACRO (TARGET_NAMING target libtype) - IF (WIN32 AND NOT MINGW) + IF (WIN32) IF (${libtype} MATCHES "SHARED") SET_TARGET_PROPERTIES (${target} PROPERTIES OUTPUT_NAME "${target}dll") ENDIF (${libtype} MATCHES "SHARED") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") IF (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (LIB_RELEASE_NAME "${libname}") SET (LIB_DEBUG_NAME "${libname}_D") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) SET (LIB_RELEASE_NAME "${libname}") SET (LIB_DEBUG_NAME "${libname}_debug") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${libtype} MATCHES "SHARED") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (LIB_RELEASE_NAME "lib${libname}") SET (LIB_DEBUG_NAME "lib${libname}_D") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) # if the generator supports configuration types or if the CMAKE_BUILD_TYPE has a value IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) SET (LIB_RELEASE_NAME "${libname}") @@ -66,7 +66,7 @@ MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) SET (LIB_RELEASE_NAME "lib${libname}") SET (LIB_DEBUG_NAME "lib${libname}_debug") ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ENDIF (${libtype} MATCHES "SHARED") SET_TARGET_PROPERTIES (${libtarget} -- cgit v0.12 From 40c3252951eba713768fd803f73513485390be34 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 16:32:59 -0500 Subject: [svn-r22195] Add PASS_REGULAR_EXPRESSION property to fortran tests to verify 0 errors. Some platforms do not return proper value in CMake ADD_TEST and results in a false positive. Tested: local linux --- fortran/test/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt index e6ddbaf..d19baea 100644 --- a/fortran/test/CMakeLists.txt +++ b/fortran/test/CMakeLists.txt @@ -73,6 +73,7 @@ SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (testhdf5_fortran PROPERTIES FOLDER test/fortran) ADD_TEST (NAME testhdf5_fortran COMMAND $) +SET_TESTS_PROPERTIES(testhdf5_fortran PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for testhdf5_fortran_1_8 ADD_EXECUTABLE (testhdf5_fortran_1_8 @@ -96,6 +97,7 @@ SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES LINKER_LANGUAGE Fortran) SET_TARGET_PROPERTIES (testhdf5_fortran_1_8 PROPERTIES FOLDER test/fortran) ADD_TEST (NAME testhdf5_fortran_1_8 COMMAND $) +SET_TESTS_PROPERTIES(testhdf5_fortran_1_8 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") #-- Adding test for fortranlib_test_F03 IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) @@ -121,6 +123,7 @@ IF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) SET_TARGET_PROPERTIES (fortranlib_test_F03 PROPERTIES FOLDER test/fortran) ADD_TEST (NAME fortranlib_test_F03 COMMAND $) + SET_TESTS_PROPERTIES(fortranlib_test_F03 PROPERTIES PASS_REGULAR_EXPRESSION "[ ]*0 error.s") ENDIF (FORTRAN_HAVE_ISO_C_BINDING AND HDF5_ENABLE_F2003) #-- Adding test for fflush1 -- cgit v0.12 From 3690a875f227fbb45b77a43eed6c6c245a635657 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 17:16:38 -0500 Subject: [svn-r22198] Update MINGW configuration (MinGW is Windows except for some issues) --- config/cmake/FindSZIP.cmake | 14 +++++++------- config/cmake/HDFLibMacros.cmake | 24 ++++++++++++------------ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index 6118f7a..05d42cf 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -44,11 +44,11 @@ MACRO (SZIP_ADJUST_LIB_VARS basename) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) @@ -90,13 +90,13 @@ FIND_PATH (SZIP_INCLUDE_DIR NO_DEFAULT_PATH ) -IF (WIN32 AND NOT MINGW) +IF (WIN32W) SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz") -ELSE (WIN32 AND NOT MINGW) +ELSE (WIN32) SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") SET (SZIP_SEARCH_RELEASE_NAMES "sz") -ENDIF (WIN32 AND NOT MINGW) +ENDIF (WIN32) # Look for the library. FIND_LIBRARY (SZIP_LIBRARY_DEBUG diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index dcf911b..b9c1fbb 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -37,11 +37,11 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) EXTERNALPROJECT_GET_PROPERTY (JPEG BINARY_DIR SOURCE_DIR) IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (JPEG_LIB_NAME "jpeg_D") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) SET (JPEG_LIB_NAME "jpeg_debug") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") SET (JPEG_LIB_NAME "jpeg") ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") @@ -151,11 +151,11 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) EXTERNALPROJECT_GET_PROPERTY (SZIP BINARY_DIR SOURCE_DIR) IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (SZIP_LIB_NAME "szip_D") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) SET (SZIP_LIB_NAME "szip_debug") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") SET (SZIP_LIB_NAME "szip") ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") @@ -263,17 +263,17 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) EXTERNALPROJECT_GET_PROPERTY (ZLIB BINARY_DIR SOURCE_DIR) IF (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (ZLIB_LIB_NAME "zlib_D") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) SET (ZLIB_LIB_NAME "z_debug") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug") - IF (WIN32 AND NOT MINGW) + IF (WIN32) SET (ZLIB_LIB_NAME "zlib") - ELSE (WIN32 AND NOT MINGW) + ELSE (WIN32) SET (ZLIB_LIB_NAME "z") - ENDIF (WIN32 AND NOT MINGW) + ENDIF (WIN32) ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug") # Create imported target szip -- cgit v0.12 From a3911962c77cefd5d79e046c784d1371a6bb47b6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 17:18:48 -0500 Subject: [svn-r22199] Correct typo --- config/cmake/FindSZIP.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index 05d42cf..8020db9 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -44,11 +44,11 @@ MACRO (SZIP_ADJUST_LIB_VARS basename) # if the generator supports configuration types then set # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) + SET (${basename}_LIBRARY optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) - # if there are no configuration types and CMAKE_BUILD_TYPE has no value - # then just use the release libraries - SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) + # if there are no configuration types and CMAKE_BUILD_TYPE has no value + # then just use the release libraries + SET (${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} ) ENDIF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) SET (${basename}_LIBRARIES optimized ${${basename}_LIBRARY_RELEASE} debug ${${basename}_LIBRARY_DEBUG}) ENDIF (${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE) @@ -90,7 +90,7 @@ FIND_PATH (SZIP_INCLUDE_DIR NO_DEFAULT_PATH ) -IF (WIN32W) +IF (WIN32) SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz") ELSE (WIN32) -- cgit v0.12 From 0911e4e78a7ae5319199e26ce5b8c734636a7bbf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 29 Mar 2012 17:26:29 -0500 Subject: [svn-r22202] Add extra search term --- config/cmake/FindSZIP.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/FindSZIP.cmake b/config/cmake/FindSZIP.cmake index 8020db9..b358862 100644 --- a/config/cmake/FindSZIP.cmake +++ b/config/cmake/FindSZIP.cmake @@ -92,10 +92,10 @@ FIND_PATH (SZIP_INCLUDE_DIR IF (WIN32) SET (SZIP_SEARCH_DEBUG_NAMES "sz_d;libsz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz") + SET (SZIP_SEARCH_RELEASE_NAMES "sz;libsz;libszip") ELSE (WIN32) SET (SZIP_SEARCH_DEBUG_NAMES "sz_d") - SET (SZIP_SEARCH_RELEASE_NAMES "sz") + SET (SZIP_SEARCH_RELEASE_NAMES "sz;szip") ENDIF (WIN32) # Look for the library. -- cgit v0.12 From ea8166cf62a36440450aa0d342d45d2d12995a6a Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 30 Mar 2012 16:42:47 -0500 Subject: [svn-r22211] STDIO VFD fixes (HDFFV-7917). Mainly Windows correctness issues (propagated from the SEC2 VFD and the old Windows VFD) and issues where large files are accessed. Tested on: 64-bit Mac OS-X 64-bit Windows 7 jam koala ostrich --- src/H5FDstdio.c | 671 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 343 insertions(+), 328 deletions(-) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 49e1957..4733eba 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -13,32 +13,24 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Robb Matzke - * Wednesday, October 22, 1997 - * - * Purpose: This is the Posix stdio.h I/O subclass of H5Flow. - * It also serves as an example of coding a simple file driver, - * therefore, it should not use any non-public definitions. +/* Programmer: Robb Matzke + * Wednesday, October 22, 1997 * - * Notes: Ported to the new H5FD architecture on 10/18/99 - QAK + * Purpose: The C STDIO virtual file driver which only uses calls from stdio.h. + * This also serves as an example of coding a simple file driver, + * therefore, it should not use any non-public definitions. * + * NOTE: This driver is not as well tested as the standard SEC2 driver + * and is not intended for production use! */ #include +#include #include #include #include -/* Disable certain warnings in PC-Lint: */ -/*lint --emacro( {534, 830}, H5P_FILE_ACCESS) */ -/*lint --emacro( {534, 830}, H5F_ACC_RDWR, H5F_ACC_EXCL) */ -/*lint -esym( 534, H5Eclear2, H5Epush2) */ - #include "hdf5.h" -#ifdef H5_HAVE_STDIO_H -#include -#endif #ifdef H5_HAVE_UNISTD_H #include #endif @@ -58,7 +50,6 @@ #endif - #ifdef MAX #undef MAX #endif /* MAX */ @@ -67,6 +58,9 @@ /* The driver identification number, initialized at runtime */ static hid_t H5FD_STDIO_g = 0; +/* The maximum number of bytes which can be written in a single I/O operation */ +static size_t H5_STDIO_MAX_IO_BYTES_g = (size_t)-1; + /* File operations */ typedef enum { H5FD_STDIO_OP_UNKNOWN=0, @@ -75,57 +69,71 @@ typedef enum { H5FD_STDIO_OP_SEEK=3 } H5FD_stdio_file_op; -/* - * The description of a file belonging to this driver. The `eoa' and `eof' +/* The description of a file belonging to this driver. The 'eoa' and 'eof' * determine the amount of hdf5 address space in use and the high-water mark - * of the file (the current size of the underlying Unix file). The `pos' + * of the file (the current size of the underlying Unix file). The 'pos' * value is used to eliminate file position updates when they would be a * no-op. Unfortunately we've found systems that use separate file position * indicators for reading and writing so the lseek can only be eliminated if * the current operation is the same as the previous operation. When opening - * a file the `eof' will be set to the current file size, `eoa' will be set - * to zero, `pos' will be set to H5F_ADDR_UNDEF (as it is when an error - * occurs), and `op' will be set to H5F_OP_UNKNOWN. + * a file the 'eof' will be set to the current file size, 'eoa' will be set + * to zero, 'pos' will be set to H5F_ADDR_UNDEF (as it is when an error + * occurs), and 'op' will be set to H5F_OP_UNKNOWN. */ typedef struct H5FD_stdio_t { - H5FD_t pub; /*public stuff, must be first */ - FILE * fp; /*the file handle */ - haddr_t eoa; /*end of allocated region */ - haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ - H5FD_stdio_file_op op; /*last operation */ - unsigned write_access; /* Flag to indicate the file was opened with write access */ + H5FD_t pub; /* public stuff, must be first */ + FILE *fp; /* the file handle */ + int fd; /* file descriptor (for truncate) */ + haddr_t eoa; /* end of allocated region */ + haddr_t eof; /* end of file; current file size */ + haddr_t pos; /* current file I/O position */ + unsigned write_access; /* Flag to indicate the file was opened with write access */ + H5FD_stdio_file_op op; /* last operation */ #ifndef H5_HAVE_WIN32_API - /* - * On most systems the combination of device and i-node number uniquely - * identify a file. + /* On most systems the combination of device and i-node number uniquely + * identify a file. Note that Cygwin, MinGW and other Windows POSIX + * environments have the stat function (which fakes inodes) + * and will use the 'device + inodes' scheme as opposed to the + * Windows code further below. */ - dev_t device; /*file device number */ - ino_t inode; /*file i-node number */ + dev_t device; /* file device number */ +#ifdef H5_VMS + ino_t inode[3]; /* file i-node number */ +#else + ino_t inode; /* file i-node number */ +#endif /* H5_VMS */ #else - /* - * On H5_HAVE_WIN32_API the low-order word of a unique identifier associated with the - * file and the volume serial number uniquely identify a file. This number - * (which, both? -rpm) may change when the system is restarted or when the - * file is opened. After a process opens a file, the identifier is - * constant until the file is closed. An application can use this - * identifier and the volume serial number to determine whether two - * handles refer to the same file. + /* Files in windows are uniquely identified by the volume serial + * number and the file index (both low and high parts). + * + * There are caveats where these numbers can change, especially + * on FAT file systems. On NTFS, however, a file should keep + * those numbers the same until renamed or deleted (though you + * can use ReplaceFile() on NTFS to keep the numbers the same + * while renaming). + * + * See the MSDN "BY_HANDLE_FILE_INFORMATION Structure" entry for + * more information. + * + * http://msdn.microsoft.com/en-us/library/aa363788(v=VS.85).aspx */ - DWORD fileindexlo; - DWORD fileindexhi; -#endif + DWORD nFileIndexLow; + DWORD nFileIndexHigh; + DWORD dwVolumeSerialNumber; + + HANDLE hFile; /* Native windows file handle */ +#endif /* H5_HAVE_WIN32_API */ } H5FD_stdio_t; /* Use similar structure as in H5private.h by defining Windows stuff first. */ #ifdef H5_HAVE_WIN32_API - #ifndef H5_HAVE_MINGW - # define file_fseek _fseeki64 - # define file_offset_t __int64 - # define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ - # define file_ftell _ftelli64 - #endif -#endif +#ifndef H5_HAVE_MINGW + #define file_fseek _fseeki64 + #define file_offset_t __int64 + #define file_ftruncate _chsize_s /* Supported in VS 2005 or newer */ + #define file_ftell _ftelli64 +#endif /* H5_HAVE_MINGW */ +#endif /* H5_HAVE_WIN32_API */ /* Use file_xxx to indicate these are local macros, avoiding confusing * with the global HD_xxx macros. @@ -134,20 +142,19 @@ typedef struct H5FD_stdio_t { */ #ifndef file_fseek #ifdef H5_HAVE_FSEEKO64 - # define file_fseek fseeko64 - # define file_offset_t off64_t - # define file_ftruncate ftruncate64 - # define file_ftell ftello64 + #define file_fseek fseeko64 + #define file_offset_t off64_t + #define file_ftruncate ftruncate64 + #define file_ftell ftello64 #else - # define file_fseek fseeko - # define file_offset_t off_t - # define file_ftruncate ftruncate - # define file_ftell ftello - #endif -#endif - -/* - * These macros check for overflow of various quantities. These macros + #define file_fseek fseeko + #define file_offset_t off_t + #define file_ftruncate ftruncate + #define file_ftell ftello + #endif /* H5_HAVE_FSEEKO64 */ +#endif /* file_fseek */ + +/* These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' @@ -188,38 +195,38 @@ static herr_t H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); static herr_t H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static const H5FD_class_t H5FD_stdio_g = { - "stdio", /*name */ - MAXADDR, /*maxaddr */ - H5F_CLOSE_WEAK, /* fc_degree */ - H5FD_stdio_term, /*terminate */ - NULL, /*sb_size */ - NULL, /*sb_encode */ - NULL, /*sb_decode */ - 0, /*fapl_size */ - NULL, /*fapl_get */ - NULL, /*fapl_copy */ - NULL, /*fapl_free */ - 0, /*dxpl_size */ - NULL, /*dxpl_copy */ - NULL, /*dxpl_free */ - H5FD_stdio_open, /*open */ - H5FD_stdio_close, /*close */ - H5FD_stdio_cmp, /*cmp */ - H5FD_stdio_query, /*query */ - NULL, /*get_type_map */ - H5FD_stdio_alloc, /*alloc */ - NULL, /*free */ - H5FD_stdio_get_eoa, /*get_eoa */ - H5FD_stdio_set_eoa, /*set_eoa */ - H5FD_stdio_get_eof, /*get_eof */ - H5FD_stdio_get_handle, /*get_handle */ - H5FD_stdio_read, /*read */ - H5FD_stdio_write, /*write */ - H5FD_stdio_flush, /*flush */ - H5FD_stdio_truncate, /*truncate */ - NULL, /*lock */ - NULL, /*unlock */ - H5FD_FLMAP_SINGLE /*fl_map */ + "stdio", /* name */ + MAXADDR, /* maxaddr */ + H5F_CLOSE_WEAK, /* fc_degree */ + H5FD_stdio_term, /* terminate */ + NULL, /* sb_size */ + NULL, /* sb_encode */ + NULL, /* sb_decode */ + 0, /* fapl_size */ + NULL, /* fapl_get */ + NULL, /* fapl_copy */ + NULL, /* fapl_free */ + 0, /* dxpl_size */ + NULL, /* dxpl_copy */ + NULL, /* dxpl_free */ + H5FD_stdio_open, /* open */ + H5FD_stdio_close, /* close */ + H5FD_stdio_cmp, /* cmp */ + H5FD_stdio_query, /* query */ + NULL, /* get_type_map */ + H5FD_stdio_alloc, /* alloc */ + NULL, /* free */ + H5FD_stdio_get_eoa, /* get_eoa */ + H5FD_stdio_set_eoa, /* set_eoa */ + H5FD_stdio_get_eof, /* get_eof */ + H5FD_stdio_get_handle, /* get_handle */ + H5FD_stdio_read, /* read */ + H5FD_stdio_write, /* write */ + H5FD_stdio_flush, /* flush */ + H5FD_stdio_truncate, /* truncate */ + NULL, /* lock */ + NULL, /* unlock */ + H5FD_FLMAP_SINGLE /* fl_map */ }; @@ -236,9 +243,6 @@ static const H5FD_class_t H5FD_stdio_g = { * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ hid_t @@ -249,8 +253,8 @@ H5FD_stdio_init(void) if (H5I_VFL!=H5Iget_type(H5FD_STDIO_g)) H5FD_STDIO_g = H5FDregister(&H5FD_stdio_g); - return(H5FD_STDIO_g); -} + return H5FD_STDIO_g; +} /* end H5FD_stdio_init() */ /*--------------------------------------------------------------------------- @@ -269,7 +273,7 @@ static herr_t H5FD_stdio_term(void) { /* Reset VFL ID */ - H5FD_STDIO_g=0; + H5FD_STDIO_g = 0; return 0; } /* end H5FD_stdio_term() */ @@ -287,15 +291,12 @@ H5FD_stdio_term(void) * Programmer: Robb Matzke * Thursday, February 19, 1998 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ herr_t H5Pset_fapl_stdio(hid_t fapl_id) { - static const char *func="H5FDset_fapl_stdio"; /*for error reporting*/ + static const char *func = "H5FDset_fapl_stdio"; /*for error reporting*/ /*NO TRACE*/ @@ -306,7 +307,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) return H5Pset_driver(fapl_id, H5FD_STDIO, NULL); -} +} /* end H5Pset_fapl_stdio() */ /*------------------------------------------------------------------------- @@ -314,50 +315,44 @@ H5Pset_fapl_stdio(hid_t fapl_id) * * Purpose: Create and/or opens a Standard C file as an HDF5 file. * - * Bugs: H5F_ACC_EXCL has a race condition. (? -QAK) - * * Errors: - * IO CANTOPENFILE File doesn't exist and CREAT wasn't - * specified. - * IO CANTOPENFILE Fopen failed. - * IO FILEEXISTS File exists but CREAT and EXCL were - * specified. + * IO CANTOPENFILE File doesn't exist and CREAT wasn't + * specified. + * IO CANTOPENFILE fopen() failed. + * IO FILEEXISTS File exists but CREAT and EXCL were + * specified. * - * Return: Success: A pointer to a new file data structure. The - * public fields will be initialized by the - * caller, which is always H5FD_open(). + * Return: + * Success: A pointer to a new file data structure. The + * public fields will be initialized by the + * caller, which is always H5FD_open(). * - * Failure: NULL + * Failure: NULL * * Programmer: Robb Matzke * Wednesday, October 22, 1997 * - * Modifications: - * Ported to VFL/H5FD layer - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static H5FD_t * H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) { - FILE *f = NULL; - unsigned write_access=0; /* File opened with write access? */ - H5FD_stdio_t *file=NULL; - static const char *func="H5FD_stdio_open"; /* Function Name for error reporting */ + FILE *f = NULL; + unsigned write_access = 0; /* File opened with write access? */ + H5FD_stdio_t *file = NULL; + static const char *func = "H5FD_stdio_open"; /* Function Name for error reporting */ #ifdef H5_HAVE_WIN32_API - HFILE filehandle; - struct _BY_HANDLE_FILE_INFORMATION fileinfo; - int fd; + struct _BY_HANDLE_FILE_INFORMATION fileinfo; #else /* H5_HAVE_WIN32_API */ - struct stat sb; + struct stat sb; #endif /* H5_HAVE_WIN32_API */ /* Sanity check on file offsets */ - assert(sizeof(file_offset_t)>=sizeof(size_t)); + assert(sizeof(file_offset_t) >= sizeof(size_t)); - /* Shut compiler up */ - fapl_id=fapl_id; + /* Quiet compiler */ + fapl_id = fapl_id; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -365,15 +360,16 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, /* Check arguments */ if (!name || !*name) H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL) - if (0==maxaddr || HADDR_UNDEF==maxaddr) + if (0 == maxaddr || HADDR_UNDEF == maxaddr) H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL) if (ADDR_OVERFLOW(maxaddr)) H5Epush_ret(func, H5E_ERR_CLS, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL) + /* Attempt to open/create the file */ if (access(name, F_OK) < 0) { if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR)) { f = fopen(name, "wb+"); - write_access=1; /* Note the write access */ + write_access = 1; /* Note the write access */ } else H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CANTOPENFILE, "file doesn't exist and CREAT wasn't specified", NULL) @@ -384,7 +380,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, f = fopen(name, "wb+"); else f = fopen(name, "rb+"); - write_access=1; /* Note the write access */ + write_access = 1; /* Note the write access */ } else { f = fopen(name, "rb"); } @@ -399,30 +395,46 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, file->fp = f; file->op = H5FD_STDIO_OP_SEEK; file->pos = HADDR_UNDEF; - file->write_access=write_access; /* Note the write_access for later */ + file->write_access = write_access; /* Note the write_access for later */ if(file_fseek(file->fp, (file_offset_t)0, SEEK_END) < 0) { file->op = H5FD_STDIO_OP_UNKNOWN; } else { - file_offset_t x = file_ftell (file->fp); - assert (x>=0); + file_offset_t x = file_ftell(file->fp); + assert (x >= 0); file->eof = (haddr_t)x; } - /* The unique key */ + /* Get the file descriptor (needed for truncate and some Windows information) */ + file->fd = fileno(file->fp); + if(file->fd < 0) + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get file descriptor", NULL); + + #ifdef H5_HAVE_WIN32_API -/*#error "Needs correct fileindexhi & fileindexlo, code below is from sec2 driver"*/ - fd = _fileno(f); - filehandle = _get_osfhandle(fd); - (void)GetFileInformationByHandle((HANDLE)filehandle, &fileinfo); - file->fileindexhi = fileinfo.nFileIndexHigh; - file->fileindexlo = fileinfo.nFileIndexLow; -#else - fstat(fileno(file->fp), &sb); + file->hFile = (HANDLE)_get_osfhandle(file->fd); + if(INVALID_HANDLE_VALUE == file->hFile) + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file handle", NULL); + + if(!GetFileInformationByHandle((HANDLE)file->hFile, &fileinfo)) + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_CANTOPENFILE, "unable to get Windows file desinformationcriptor", NULL); + + file->nFileIndexHigh = fileinfo.nFileIndexHigh; + file->nFileIndexLow = fileinfo.nFileIndexLow; + file->dwVolumeSerialNumber = fileinfo.dwVolumeSerialNumber; +#else /* H5_HAVE_WIN32_API */ + fstat(file->fd, &sb); file->device = sb.st_dev; +#ifdef H5_VMS + file->inode[0] = sb.st_ino[0]; + file->inode[1] = sb.st_ino[1]; + file->inode[2] = sb.st_ino[2]; +#else /* H5_VMS */ file->inode = sb.st_ino; -#endif - return((H5FD_t*)file); -} /* end H5FD_stdio_open() */ +#endif /* H5_VMS */ +#endif /* H5_HAVE_WIN32_API */ + + return (H5FD_t*)file; +} /* end H5FD_stdio_open() */ /*------------------------------------------------------------------------- @@ -438,16 +450,13 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, * Programmer: Robb Matzke * Wednesday, October 22, 1997 * - * Modifications: - * Ported to VFL/H5FD layer - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_close(H5FD_t *_file) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; - static const char *func="H5FD_stdio_close"; /* Function Name for error reporting */ + static const char *func = "H5FD_stdio_close"; /* Function Name for error reporting */ /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -457,8 +466,8 @@ H5FD_stdio_close(H5FD_t *_file) free(file); - return(0); -} + return 0; +} /* end H5FD_stdio_close() */ /*------------------------------------------------------------------------- @@ -467,17 +476,14 @@ H5FD_stdio_close(H5FD_t *_file) * Purpose: Compares two files belonging to this driver using an * arbitrary (but consistent) ordering. * - * Return: Success: A value like strcmp() + * Return: + * Success: A value like strcmp() * - * Failure: never fails (arguments were checked by the - * caller). + * Failure: never fails (arguments were checked by the caller). * * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static int @@ -490,30 +496,37 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) H5Eclear2(H5E_DEFAULT); #ifdef H5_HAVE_WIN32_API - if (f1->fileindexhi < f2->fileindexhi) return -1; - if (f1->fileindexhi > f2->fileindexhi) return 1; + if(f1->dwVolumeSerialNumber < f2->dwVolumeSerialNumber) return -1; + if(f1->dwVolumeSerialNumber > f2->dwVolumeSerialNumber) return 1; - if (f1->fileindexlo < f2->fileindexlo) return -1; - if (f1->fileindexlo > f2->fileindexlo) return 1; + if(f1->nFileIndexHigh < f2->nFileIndexHigh) return -1; + if(f1->nFileIndexHigh > f2->nFileIndexHigh) return 1; -#else + if(f1->nFileIndexLow < f2->nFileIndexLow) return -1; + if(f1->nFileIndexLow > f2->nFileIndexLow) return 1; +#else /* H5_HAVE_WIN32_API */ #ifdef H5_DEV_T_IS_SCALAR - if (f1->device < f2->device) return -1; - if (f1->device > f2->device) return 1; + if(f1->device < f2->device) return -1; + if(f1->device > f2->device) return 1; #else /* H5_DEV_T_IS_SCALAR */ /* If dev_t isn't a scalar value on this system, just use memcmp to * determine if the values are the same or not. The actual return value * shouldn't really matter... */ - if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t))<0) return -1; - if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t))>0) return 1; + if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) < 0) return -1; + if(memcmp(&(f1->device),&(f2->device),sizeof(dev_t)) > 0) return 1; #endif /* H5_DEV_T_IS_SCALAR */ +#ifdef H5_VMS + if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) < 0) return -1; + if(memcmp(&(f1->inode), &(f2->inode), 3 * sizeof(ino_t)) > 0) return 1; +#else /* H5_VMS */ + if(f1->inode < f2->inode) return -1; + if(f1->inode > f2->inode) return 1; +#endif /* H5_VMS */ +#endif /* H5_HAVE_WIN32_API */ - if (f1->inode < f2->inode) return -1; - if (f1->inode > f2->inode) return 1; -#endif return 0; -} +} /* H5FD_stdio_cmp() */ /*------------------------------------------------------------------------- @@ -529,14 +542,12 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) { - /* Shut compiler up */ + /* Quiet the compiler */ _f=_f; /* Set the VFL feature flags that this driver supports */ @@ -548,37 +559,35 @@ H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) *flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ } - return(0); -} + return 0; +} /* end H5FD_stdio_query() */ /*------------------------------------------------------------------------- * Function: H5FD_stdio_alloc * - * Purpose: Allocates file memory. If fseeko isn't available, makes + * Purpose: Allocates file memory. If fseeko isn't available, makes * sure the file size isn't bigger than 2GB because the * parameter OFFSET of fseek is of the type LONG INT, limiting * the file size to 2GB. * - * Return: Success: Address of new memory + * Return: + * Success: Address of new memory * - * Failure: HADDR_UNDEF + * Failure: HADDR_UNDEF * * Programmer: Raymond Lu * 30 March 2007 * - * Modifications: - * *------------------------------------------------------------------------- */ static haddr_t H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxpl_id, hsize_t size) { - H5FD_stdio_t *file = (H5FD_stdio_t*)_file; - haddr_t addr; - haddr_t ret_value; /* Return value */ + H5FD_stdio_t *file = (H5FD_stdio_t*)_file; + haddr_t addr; - /* Shut compiler up */ + /* Quiet compiler */ type = type; dxpl_id = dxpl_id; @@ -597,19 +606,16 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp file->eoa = addr + size; - /* Set return value */ - ret_value = addr; - - return(ret_value); -} /* H5FD_stdio_alloc() */ + return addr; +} /* end H5FD_stdio_alloc() */ /*------------------------------------------------------------------------- * Function: H5FD_stdio_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker - * is the first address past the last byte allocated in the - * format address space. + * is the first address past the last byte allocated in the + * format address space. * * Return: Success: The end-of-address marker. * @@ -618,28 +624,21 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp * Programmer: Robb Matzke * Monday, August 2, 1999 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. - * *------------------------------------------------------------------------- */ static haddr_t -H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*unused*/ type) +H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type) { - const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; + const H5FD_stdio_t *file = (const H5FD_stdio_t *)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Shut compiler up */ + /* Quiet compiler */ type = type; - return(file->eoa); -} + return file->eoa; +} /* end H5FD_stdio_get_eoa() */ /*------------------------------------------------------------------------- @@ -651,33 +650,27 @@ H5FD_stdio_get_eoa(const H5FD_t *_file, H5FD_mem_t /*unused*/ type) * * Return: Success: 0 * - * Failure: -1 + * Failure: Does not fail * * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * - * Raymond Lu - * 21 Dec. 2006 - * Added the parameter TYPE. It's only used for MULTI driver. *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*unused*/ type, haddr_t addr) +H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, haddr_t addr) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - /* Shut compiler up */ + /* Quiet the compiler */ type = type; file->eoa = addr; - return(0); + return 0; } @@ -697,9 +690,6 @@ H5FD_stdio_set_eoa(H5FD_t *_file, H5FD_mem_t /*unused*/ type, haddr_t addr) * Programmer: Robb Matzke * Thursday, July 29, 1999 * - * Modifications: - * Stolen from the sec2 driver - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static haddr_t @@ -710,8 +700,8 @@ H5FD_stdio_get_eof(const H5FD_t *_file) /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); - return(MAX(file->eof, file->eoa)); -} + return MAX(file->eof, file->eoa); +} /* end H5FD_stdio_get_eof() */ /*------------------------------------------------------------------------- @@ -724,64 +714,56 @@ H5FD_stdio_get_eof(const H5FD_t *_file) * Programmer: Raymond Lu * Sept. 16, 2002 * - * Modifications: - * *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) { H5FD_stdio_t *file = (H5FD_stdio_t *)_file; - static const char *func="H5FD_stdio_get_handle"; /* Function Name for error reporting */ + static const char *func = "H5FD_stdio_get_handle"; /* Function Name for error reporting */ - /* Shut compiler up */ - fapl=fapl; + /* Quiet the compiler */ + fapl = fapl; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); *file_handle = &(file->fp); - if(*file_handle==NULL) + if(*file_handle == NULL) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1) - return(0); -} + + return 0; +} /* end H5FD_stdio_get_handle() */ /*------------------------------------------------------------------------- - * Function: H5F_stdio_read + * Function: H5FD_stdio_read * * Purpose: Reads SIZE bytes beginning at address ADDR in file LF and * places them in buffer BUF. Reading past the logical or * physical end of file returns zeros instead of failing. * * Errors: - * IO READERROR Fread failed. - * IO SEEKERROR Fseek failed. + * IO READERROR fread failed. + * IO SEEKERROR fseek failed. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Wednesday, October 22, 1997 * - * Modifications: - * June 2, 1998 Albert Cheng - * Added xfer_mode argument - * - * Ported to VFL/H5FD layer - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static herr_t H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, void *buf/*out*/) { - size_t n; H5FD_stdio_t *file = (H5FD_stdio_t*)_file; - static const char *func="H5FD_stdio_read"; /* Function Name for error reporting */ + static const char *func = "H5FD_stdio_read"; /* Function Name for error reporting */ - /* Shut compiler up */ - type=type; - dxpl_id=dxpl_id; + /* Quiet the compiler */ + type = type; + dxpl_id = dxpl_id; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); @@ -796,16 +778,14 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz /* Check easy cases */ if (0 == size) - return(0); + return 0; if ((haddr_t)addr >= file->eof) { memset(buf, 0, size); - return(0); + return 0; } - /* - * Seek to the correct file position. - */ - if (!(file->op == H5FD_STDIO_OP_READ || file->op==H5FD_STDIO_OP_SEEK) || + /* Seek to the correct file position. */ + if (!(file->op == H5FD_STDIO_OP_READ || file->op == H5FD_STDIO_OP_SEEK) || file->pos != addr) { if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) { file->op = H5FD_STDIO_OP_UNKNOWN; @@ -815,59 +795,70 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz file->pos = addr; } - /* - * Read zeros past the logical end of file (physical is handled below) - */ + /* Read zeros past the logical end of file (physical is handled below) */ if (addr + size > file->eof) { size_t nbytes = (size_t) (addr + size - file->eof); memset((unsigned char *)buf + size - nbytes, 0, nbytes); size -= nbytes; } - /* - * Read the data. Since we're reading single-byte values, a partial read + /* Read the data. Since we're reading single-byte values, a partial read * will advance the file position by N. If N is zero or an error * occurs then the file position is undefined. */ - n = fread(buf, (size_t)1, size, file->fp); - if(n == 0 && ferror(file->fp)) { - file->op = H5FD_STDIO_OP_UNKNOWN; - file->pos = HADDR_UNDEF; - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1) - } else if (n < size) { - memset((unsigned char *)buf + n, 0, (size - n)); - } + while(size > 0) { - /* - * Update the file position data. - */ + size_t bytes_in = 0; /* # of bytes to read */ + size_t bytes_read = 0; /* # of bytes actually read */ + size_t item_size = 1; /* size of items in bytes */ + + if(size > H5_STDIO_MAX_IO_BYTES_g) + bytes_in = H5_STDIO_MAX_IO_BYTES_g; + else + bytes_in = size; + + bytes_read = fread(buf, item_size, bytes_in, file->fp); + + if(0 == bytes_read && ferror(file->fp)) { /* error */ + file->op = H5FD_STDIO_OP_UNKNOWN; + file->pos = HADDR_UNDEF; + H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_READERROR, "fread failed", -1) + } /* end if */ + + if(0 == bytes_read && feof(file->fp)) { + /* end of file but not end of format address space */ + memset((unsigned char *)buf, 0, size); + break; + } /* end if */ + + size -= bytes_read; + addr += (haddr_t)bytes_read; + buf = (char *)buf + bytes_read; + } /* end while */ + + /* Update the file position data. */ file->op = H5FD_STDIO_OP_READ; - file->pos = addr+n; /*checked for overflow above*/ - return(0); + file->pos = addr; + + return 0; } /*------------------------------------------------------------------------- - * Function: H5F_stdio_write + * Function: H5FD_stdio_write * * Purpose: Writes SIZE bytes from the beginning of BUF into file LF at * file address ADDR. * * Errors: - * IO SEEKERROR Fseek failed. - * IO WRITEERROR Fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fwrite failed. * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke * Wednesday, October 22, 1997 * - * Modifications: - * June 2, 1998 Albert Cheng - * Added xfer_mode argument - * - * Ported to VFL/H5FD layer - QAK, 10/18/99 - * *------------------------------------------------------------------------- */ static herr_t @@ -875,26 +866,24 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; - static const char *func="H5FD_stdio_write"; /* Function Name for error reporting */ + static const char *func = "H5FD_stdio_write"; /* Function Name for error reporting */ - /* Shut compiler up */ - dxpl_id=dxpl_id; - type=type; + /* Quiet the compiler */ + dxpl_id = dxpl_id; + type = type; /* Clear the error stack */ H5Eclear2(H5E_DEFAULT); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF == addr) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - if (addr+size>file->eoa) + if (addr+size > file->eoa) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - /* - * Seek to the correct file position. - */ + /* Seek to the correct file position. */ if ((file->op != H5FD_STDIO_OP_WRITE && file->op != H5FD_STDIO_OP_SEEK) || file->pos != addr) { if (file_fseek(file->fp, (file_offset_t)addr, SEEK_SET) < 0) { @@ -905,33 +894,51 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, file->pos = addr; } - /* - * Write the buffer. On successful return, the file position will be - * advanced by the number of bytes read. Otherwise nobody knows where it - * is. + /* Write the buffer. On successful return, the file position will be + * advanced by the number of bytes read. On failure, the file position is + * undefined. */ - if(size != fwrite(buf, (size_t)1, size, file->fp)) { - file->op = H5FD_STDIO_OP_UNKNOWN; - file->pos = HADDR_UNDEF; - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) + while(size > 0) { + + size_t bytes_in = 0; /* # of bytes to write */ + size_t bytes_wrote = 0; /* # of bytes written */ + size_t item_size = 1; /* size of items in bytes */ + + if(size > H5_STDIO_MAX_IO_BYTES_g) + bytes_in = H5_STDIO_MAX_IO_BYTES_g; + else + bytes_in = size; + + bytes_wrote = fwrite(buf, item_size, bytes_in, file->fp); + + if(bytes_wrote != bytes_in || (0 == bytes_wrote && ferror(file->fp))) { /* error */ + file->op = H5FD_STDIO_OP_UNKNOWN; + file->pos = HADDR_UNDEF; + H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) + } /* end if */ + + assert(bytes_wrote > 0); + assert((size_t)bytes_wrote <= size); + + size -= bytes_wrote; + addr += (haddr_t)bytes_wrote; + buf = (const char *)buf + bytes_wrote; } - /* - * Update seek optimizing data. - */ + /* Update seek optimizing data. */ file->op = H5FD_STDIO_OP_WRITE; - file->pos = addr + size; + file->pos = addr; /* Update EOF if necessary */ - if (file->pos>file->eof) + if (file->pos > file->eof) file->eof = file->pos; - return(0); + return 0; } /*------------------------------------------------------------------------- - * Function: H5F_stdio_flush + * Function: H5FD_stdio_flush * * Purpose: Makes sure that all data is on disk. * @@ -952,7 +959,7 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_flush"; /* Function Name for error reporting */ - /* Shut compiler up */ + /* Quiet the compiler */ dxpl_id = dxpl_id; /* Clear the error stack */ @@ -960,7 +967,6 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) /* Only try to flush the file if we have write access */ if(file->write_access) { - /* Flush */ if(!closing) { if(fflush(file->fp) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fflush failed", -1) @@ -971,12 +977,12 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) } /* end if */ } /* end if */ - return(0); + return 0; } /* end H5FD_stdio_flush() */ /*------------------------------------------------------------------------- - * Function: H5F_stdio_truncate + * Function: H5FD_stdio_truncate * * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. @@ -990,9 +996,6 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) * Programmer: Quincey Koziol * Thursday, January 31, 2008 * - * Modifications: - * Vailin Choi; June 2010 - * Fix for window failures manifested from tests in mf.c. *------------------------------------------------------------------------- */ static herr_t @@ -1001,7 +1004,7 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) H5FD_stdio_t *file = (H5FD_stdio_t*)_file; static const char *func = "H5FD_stdio_truncate"; /* Function Name for error reporting */ - /* Shut compiler up */ + /* Quiet the compiler */ dxpl_id = dxpl_id; closing = closing; @@ -1012,30 +1015,42 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) if(file->write_access) { /* Makes sure that the true file size is the same as the end-of-address. */ if(file->eoa != file->eof) { - int fd = fileno(file->fp); /* File descriptor for HDF5 file */ #ifdef H5_HAVE_WIN32_API - HFILE filehandle; /* Windows file handle */ - LARGE_INTEGER li; /* 64-bit integer for SetFilePointer() call */ + LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ + DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() + * Only used as an error code here. + */ + DWORD dwError; /* DWORD error code from GetLastError() */ + BOOL bError; /* Boolean error flag */ - /* Reset seek offset to beginning of file, so that file isn't re-extended later */ + /* Reset seek offset to beginning of file, so that file isn't re-extended later */ rewind(file->fp); - /* Map the posix file handle to a Windows file handle */ - filehandle = _get_osfhandle(fd); - - /* Translate 64-bit integers into form Windows wants */ - /* [This algorithm is from the Windows documentation for SetFilePointer()] */ - li.QuadPart = (LONGLONG)file->eoa; - (void)SetFilePointer((HANDLE)filehandle, li.LowPart, &li.HighPart, FILE_BEGIN); - if(SetEndOfFile((HANDLE)filehandle) == 0) + /* Windows uses this odd QuadPart union for 32/64-bit portability */ + li.QuadPart = (__int64)file->eoa; + + /* Extend the file to make sure it's large enough. + * + * Since INVALID_SET_FILE_POINTER can technically be a valid return value + * from SetFilePointer(), we also need to check GetLastError(). + */ + dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); + if(INVALID_SET_FILE_POINTER == dwPtrLow) { + dwError = GetLastError(); + if(dwError != NO_ERROR ) + H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_FILEOPEN, "unable to set file pointer", -1) + } + + bError = SetEndOfFile(file->hFile); + if(0 == bError) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) #else /* H5_HAVE_WIN32_API */ /* Reset seek offset to beginning of file, so that file isn't re-extended later */ rewind(file->fp); /* Truncate file to proper length */ - if(-1 == file_ftruncate(fd, (file_offset_t)file->eoa)) + if(-1 == file_ftruncate(file->fd, (file_offset_t)file->eoa)) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "unable to truncate/extend file properly", -1) #endif /* H5_HAVE_WIN32_API */ @@ -1050,10 +1065,10 @@ H5FD_stdio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing) else { /* Double-check for problems */ if(file->eoa > file->eof) - H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa>eof!", -1) - } /* end else */ + H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_TRUNCATED, "eoa > eof!", -1) + } /* end else */ - return(0); + return 0; } /* end H5FD_stdio_truncate() */ -- cgit v0.12 From b51ffb25fe610675a7470cf50efed5bcdf2bf79f Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Fri, 30 Mar 2012 18:24:31 -0500 Subject: [svn-r22214] Feature: HDFFV-7981 Added test to verify h5repack --metadata option produces bigger size file. Tested: h5committest (koala, jam, ostrich). --- tools/h5repack/h5repack.sh.in | 60 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in index 1654b0d..236c555 100644 --- a/tools/h5repack/h5repack.sh.in +++ b/tools/h5repack/h5repack.sh.in @@ -147,20 +147,25 @@ COPY_TESTFILES_TO_TESTDIR() done } +# Print a $* message left justified in a field of 70 characters +# +MESSAGE() { + SPACES=" " + echo "$* $SPACES" | cut -c1-70 | tr -d '\012' +} + # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' + MESSAGE "Testing $*" } # Print a line-line message left justified in a field of 70 characters # beginning with the word "Verifying". # VERIFY() { - SPACES=" " - echo "Verifying h5diff output $* $SPACES" | cut -c1-70 | tr -d '\012' + MESSAGE "Verifying h5diff output $*" } # Print a message that a test has been skipped (because a required filter @@ -385,6 +390,49 @@ TOOLTESTV() rm -f $actual $actual_err $actual_sav } +# TOOLTEST_META: +# Test metadata block size option. +# Reason to create a function here is to localize all special steps related to +# metadata block size option in one place. This is a quick solution. More +# thought out solution needed when there is more time. +# +# $1: test input file +# $2:$: metadata options (either "-M size" or "--metadata_block_size=size") +# +# Algorithm: +# Run it once without the metadata option ($2-$); +# Save the result output file; +# Run it second time with the metadata option; +# Verify the output file of second run is larger than the one of 1st run. +TOOLTEST_META() +{ + input_file=$1 + outfile="$TESTDIR/out.$1" + + # Use TOOLTEST_MAIN to run because it does not remove the output file. + # 1st run, without metadata option + TOOLTEST_MAIN $1 + # get the size of the first output file + size1=`wc -c $outfile | cut -d' ' -f1` + + # 2nd run with metadata option + TOOLTEST_MAIN $* + # get the size of the second output file + size2=`wc -c $outfile | cut -d' ' -f1` + + # verify sizes. + MESSAGE "Verify the sizes of both output files ($size1 vs $size2)" + if [ $size1 -lt $size2 ]; then + # pass + echo " PASSED" + else + #fail + echo "*FAILED*" + fi + + rm -f $outfile +} + # This is different from $srcdir/../../bin/output_filter.sh STDOUT_FILTER() { result_file=$1 @@ -809,8 +857,8 @@ TOOLTEST h5repack_attr_refs.h5 TOOLTEST h5diff_attr1.h5 # tests for metadata block size option ('-M') -TOOLTEST h5repack_layout.h5 -M 8192 -TOOLTEST h5repack_layout.h5 --metadata_block_size=8192 +TOOLTEST_META h5repack_layout.h5 -M 8192 +TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then echo "All $TESTNAME tests passed." -- cgit v0.12 From c2a9dcb8977f81ff8e66bfd41c72f106993d3086 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 31 Mar 2012 03:49:35 -0500 Subject: [svn-r22219] Description: Merge "file image" changes from feature branch back to trunk. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (h5committest upcoming) --- MANIFEST | 47 +- bin/trace | 1 + hl/src/H5LT.c | 571 +++++++++++++++++- hl/src/H5LTpublic.h | 18 + hl/test/Makefile.am | 4 +- hl/test/Makefile.in | 27 +- hl/test/h5hltest.h | 6 +- hl/test/test_file_image.c | 518 ++++++++++++++++ src/H5Dint.c | 3 +- src/H5E.c | 12 +- src/H5Edefin.h | 1 + src/H5Einit.h | 5 + src/H5Epubgen.h | 2 + src/H5Eterm.h | 3 +- src/H5F.c | 284 ++++++--- src/H5FD.c | 82 ++- src/H5FDcore.c | 293 ++++++--- src/H5FDfamily.c | 2 +- src/H5FDlog.c | 2 +- src/H5FDprivate.h | 26 +- src/H5FDpublic.h | 40 ++ src/H5FDsec2.c | 2 +- src/H5Fprivate.h | 5 +- src/H5Fpublic.h | 1 + src/H5Gname.c | 11 +- src/H5I.c | 144 +++-- src/H5Iprivate.h | 2 +- src/H5Oattribute.c | 11 +- src/H5Pfapl.c | 497 ++++++++++++++++ src/H5Pint.c | 54 +- src/H5Ppublic.h | 6 + src/H5T.c | 3 +- src/H5err.txt | 1 + test/Makefile.am | 4 +- test/Makefile.in | 58 +- test/file_image.c | 1335 ++++++++++++++++++++++++++++++++++++++++++ test/file_image_core_test.h5 | Bin 0 -> 18528 bytes test/gen_file_image.c | 91 +++ testpar/Makefile.am | 4 +- testpar/Makefile.in | 12 +- testpar/t_file_image.c | 395 +++++++++++++ testpar/testphdf5.c | 7 + testpar/testphdf5.h | 1 + 43 files changed, 4260 insertions(+), 331 deletions(-) create mode 100644 hl/test/test_file_image.c create mode 100644 test/file_image.c create mode 100644 test/file_image_core_test.h5 create mode 100644 test/gen_file_image.c create mode 100644 testpar/t_file_image.c diff --git a/MANIFEST b/MANIFEST index b1c207d..a163532 100644 --- a/MANIFEST +++ b/MANIFEST @@ -963,32 +963,35 @@ ./test/filespace_1_8.h5 ./test/filespace_1_6.h5 ./test/freespace.c +./test/file_image.c +./test/file_image_core_test.h5 ./test/fill_old.h5 ./test/fillval.c ./test/filter_fail.c ./test/flush1.c ./test/flush2.c -./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_ -./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_ -./test/gen_bogus.c _DO_NOT_DISTRIBUTE_ -./test/gen_cross.c _DO_NOT_DISTRIBUTE_ -./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ -./test/gen_filespace.c _DO_NOT_DISTRIBUTE_ -./test/gen_mergemsg.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_fill.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_new_super.c _DO_NOT_DISTRIBUTE_ -./test/gen_noencoder.c _DO_NOT_DISTRIBUTE_ -./test/gen_nullspace.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_array.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_group.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_ -./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_ -./test/gen_sizes_lheap.c _DO_NOT_DISTRIBUTE_ -./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ -./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ +./test/gen_bad_ohdr.c _DO_NOT_DISTRIBUTE_ +./test/gen_bad_compound.c _DO_NOT_DISTRIBUTE_ +./test/gen_bogus.c _DO_NOT_DISTRIBUTE_ +./test/gen_cross.c _DO_NOT_DISTRIBUTE_ +./test/gen_deflate.c _DO_NOT_DISTRIBUTE_ +./test/gen_file_image.c _DO_NOT_DISTRIBUTE_ +./test/gen_filespace.c _DO_NOT_DISTRIBUTE_ +./test/gen_mergemsg.c _DO_NOT_DISTRIBUTE_ +./test/gen_new_array.c _DO_NOT_DISTRIBUTE_ +./test/gen_new_fill.c _DO_NOT_DISTRIBUTE_ +./test/gen_new_group.c _DO_NOT_DISTRIBUTE_ +./test/gen_new_mtime.c _DO_NOT_DISTRIBUTE_ +./test/gen_new_super.c _DO_NOT_DISTRIBUTE_ +./test/gen_noencoder.c _DO_NOT_DISTRIBUTE_ +./test/gen_nullspace.c _DO_NOT_DISTRIBUTE_ +./test/gen_old_array.c _DO_NOT_DISTRIBUTE_ +./test/gen_old_group.c _DO_NOT_DISTRIBUTE_ +./test/gen_old_layout.c _DO_NOT_DISTRIBUTE_ +./test/gen_old_mtime.c _DO_NOT_DISTRIBUTE_ +./test/gen_sizes_lheap.c _DO_NOT_DISTRIBUTE_ +./test/gen_specmetaread.c _DO_NOT_DISTRIBUTE_ +./test/gen_udlinks.c _DO_NOT_DISTRIBUTE_ ./test/getname.c ./test/gheap.c ./test/group_old.h5 @@ -1083,6 +1086,7 @@ ./testpar/t_cache.c ./testpar/t_dset.c ./testpar/t_file.c +./testpar/t_file_image.c ./testpar/t_mdset.c ./testpar/t_mpi.c ./testpar/t_ph5basic.c @@ -2075,6 +2079,7 @@ ./hl/test/sepia.pal ./hl/test/gen_test_ds.c ./hl/test/test_ds.c +./hl/test/test_file_image.c ./hl/test/test_image.c ./hl/test/test_lite.c ./hl/test/test_packet.c diff --git a/bin/trace b/bin/trace index bfaae19..0235049 100755 --- a/bin/trace +++ b/bin/trace @@ -109,6 +109,7 @@ $Source = ""; "H5FD_t" => "x", "H5FD_class_t" => "x", "H5FD_stream_fapl_t" => "x", + "H5FD_file_image_callbacks_t" => "x", "H5G_iterate_t" => "x", "H5G_info_t" => "x", "H5I_free_t" => "x", diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index eeaceeb..8136b11 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -17,6 +17,7 @@ #include #include #include + #include "H5LTprivate.h" #include "H5private.h" @@ -31,7 +32,461 @@ char *myinput; size_t indent = 0; +/* File Image operations + + A file image is a representation of an HDF5 file in a memory + buffer. In order to perform operations on an image in a similar way + to a file, the application buffer is copied to a FAPL buffer, which + in turn is copied to a VFD buffer. Buffer copying can decrease + performance, especially when using large file images. A solution to + this issue is to simulate the copying of the application buffer, + when actually the same buffer is used for the FAPL and the VFD. + This is implemented by using callbacks that simulate the standard + functions for memory management (additional callbacks are used for + the management of associated data structures). From the application + standpoint, a file handle can be obtained from a file image by using + the API routine H5LTopen_file_image(). This function takes a flag + argument that indicates the HDF5 library how to handle the given image; + several flag values can be combined by using the bitwise OR operator. + Valid flag values include: + + H5LT_FILE_IMAGE_OPEN_RW indicates the HDF5 library to open the file + image in read/write mode. Default is read-only mode. + + H5LT_FILE_IMAGE_DONT_COPY indicates the HDF5 library to not copy the + supplied user buffer; the same buffer will be handled by the FAPL and + the VFD driver. Default operation copies the user buffer to the FAPL and + VFD driver. + + H5LT_FILE_IMAGE_DONT_RELEASE indicates the HDF5 library to not release + the buffer handled by the FAPL and the VFD upon closing. This flag value + is only applicable when the flag value H5LT_FILE_IMAGE_DONT_COPY is set as + well. The application is responsible to release the image buffer. +*/ + +/* Data structure to pass application data to callbacks. */ +typedef struct { + void *app_image_ptr; /* Pointer to application buffer */ + size_t app_image_size; /* Size of application buffer */ + void *fapl_image_ptr; /* Pointer to FAPL buffer */ + size_t fapl_image_size; /* Size of FAPL buffer */ + int fapl_ref_count; /* Reference counter for FAPL buffer */ + void *vfd_image_ptr; /* Pointer to VFD buffer */ + size_t vfd_image_size; /* Size of VFD buffer */ + int vfd_ref_count; /* Reference counter for VFD buffer */ + unsigned flags; /* Flags indicate how the file image will */ + /* be open */ + int ref_count; /* Reference counter on udata struct */ +} H5LT_file_image_ud_t; + +/* callbacks prototypes for file image ops */ +static void *image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *udata); +static void *image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op, void *udata); +static void *image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *udata); +static herr_t image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *udata); +static void *udata_copy(void *udata); +static herr_t udata_free(void *udata); + +/* Definition of callbacks for file image operations. */ + + +/*------------------------------------------------------------------------- +* Function: image_malloc +* +* Purpose: Simulates malloc() function to avoid copying file images. +* The application buffer is set to the buffer on only one FAPL. +* Then the FAPL buffer can be copied to other FAPL buffers or +* to only one VFD buffer. +* +* Return: Address of "allocated" buffer, if successful. Otherwise, it returns +* NULL. +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static void * +image_malloc(size_t size, H5FD_file_image_op_t file_image_op, void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + void * return_value = NULL; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + + switch ( file_image_op ) { + /* the app buffer is "copied" to only one FAPL. Afterwards, FAPLs can be "copied" */ + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: + if (udata->app_image_ptr == NULL) + goto out; + if (udata->app_image_size != size) + goto out; + if (udata->fapl_image_ptr != NULL) + goto out; + if (udata->fapl_image_size != 0) + goto out; + if (udata->fapl_ref_count != 0) + goto out; + + udata->fapl_image_ptr = udata->app_image_ptr; + udata->fapl_image_size = udata->app_image_size; + return_value = udata->fapl_image_ptr; + udata->fapl_ref_count++; + break; + + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: + if (udata->fapl_image_ptr == NULL) + goto out; + if (udata->fapl_image_size != size) + goto out; + if (udata->fapl_ref_count == 0) + goto out; + return_value = udata->fapl_image_ptr; + udata->fapl_ref_count++; + break; + + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: + goto out; + + case H5FD_FILE_IMAGE_OP_FILE_OPEN: + /* FAPL buffer is "copied" to only one VFD buffer */ + if (udata->vfd_image_ptr != NULL) + goto out; + if (udata->vfd_image_size != 0) + goto out; + if (udata->vfd_ref_count != 0) + goto out; + if (udata->fapl_image_ptr == NULL) + goto out; + if (udata->fapl_image_size != size) + goto out; + if (udata->fapl_ref_count == 0) + goto out; + + udata->vfd_image_ptr = udata->fapl_image_ptr; + udata->vfd_image_size = size; + udata->vfd_ref_count++; + return_value = udata->vfd_image_ptr; + break; + + /* added unused labels to shut the compiler up */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + case H5FD_FILE_IMAGE_OP_FILE_CLOSE: + default: + goto out; + } /* end switch */ + + return(return_value); + +out: + return NULL; +} /* end image_malloc() */ + + +/*------------------------------------------------------------------------- +* Function: image_memcpy +* +* Purpose: Simulates memcpy() function to avoid copying file images. +* The image buffer can be set to only one FAPL buffer, and +* "copied" to only one VFD buffer. The FAPL buffer can be +* "copied" to other FAPLs buffers. +* +* Return: The address of the destination buffer, if successful. Otherwise, it +* returns NULL. +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static void * +image_memcpy(void *dest, const void *src, size_t size, H5FD_file_image_op_t file_image_op, + void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + + switch(file_image_op) { + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: + if (dest != udata->fapl_image_ptr) + goto out; + if (src != udata->app_image_ptr) + goto out; + if (size != udata->fapl_image_size) + goto out; + if (size != udata->app_image_size) + goto out; + if (udata->fapl_ref_count == 0) + goto out; + break; + + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: + if (dest != udata->fapl_image_ptr) + goto out; + if (src != udata->fapl_image_ptr) + goto out; + if (size != udata->fapl_image_size) + goto out; + if (udata->fapl_ref_count < 2) + goto out; + break; + + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: + goto out; + + case H5FD_FILE_IMAGE_OP_FILE_OPEN: + if (dest != udata->vfd_image_ptr) + goto out; + if (src != udata->fapl_image_ptr) + goto out; + if (size != udata->vfd_image_size) + goto out; + if (size != udata->fapl_image_size) + goto out; + if (udata->fapl_ref_count == 0) + goto out; + if (udata->vfd_ref_count != 1) + goto out; + break; + + /* added unused labels to shut the compiler up */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + case H5FD_FILE_IMAGE_OP_FILE_CLOSE: + default: + goto out; + } /* end switch */ + + return(dest); + +out: + return NULL; +} /* end image_memcpy() */ + + +/*------------------------------------------------------------------------- +* Function: image_realloc +* +* Purpose: Reallocates the shared application image buffer and updates data +* structures that manage buffer "copying". +* +* Return: Address of reallocated buffer, if successful. Otherwise, it returns +* NULL. +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static void * +image_realloc(void *ptr, size_t size, H5FD_file_image_op_t file_image_op, void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + void * return_value = NULL; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + + /* realloc() is not allowed when the HDF5 library won't release the image + buffer because reallocation may change the address of the buffer. The + new address cannot be communicated to the application to release it. */ + if (udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE) + goto out; + + /* realloc() is not allowed if the image is open in read-only mode */ + if (!(udata->flags & H5LT_FILE_IMAGE_OPEN_RW)) + goto out; + + if (file_image_op == H5FD_FILE_IMAGE_OP_FILE_RESIZE) { + if (udata->vfd_image_ptr != ptr) + goto out; + + if (udata->vfd_ref_count != 1) + goto out; + + if (NULL == (udata->vfd_image_ptr = HDrealloc(ptr, size))) + goto out; + + udata->vfd_image_size = size; + return_value = udata->vfd_image_ptr; + } /* end if */ + else + goto out; + + return(return_value); + +out: + return NULL; +} /* end image_realloc() */ + + +/*------------------------------------------------------------------------- +* Function: image_free +* +* Purpose: Simulates deallocation of FAPL and VFD buffers by decreasing +* reference counters. Shared application buffer is actually +* deallocated if there are no outstanding references. +* +* Return: SUCCEED or FAIL +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static herr_t +image_free(void *ptr, H5FD_file_image_op_t file_image_op, void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + + switch(file_image_op) { + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE: + if (udata->fapl_image_ptr != ptr) + goto out; + if (udata->fapl_ref_count == 0) + goto out; + + udata->fapl_ref_count--; + + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && + !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { + HDfree(udata->fapl_image_ptr); + udata->app_image_ptr = NULL; + udata->fapl_image_ptr = NULL; + udata->vfd_image_ptr = NULL; + } /* end if */ + break; + + case H5FD_FILE_IMAGE_OP_FILE_CLOSE: + if (udata->vfd_image_ptr != ptr) + goto out; + if (udata->vfd_ref_count != 1) + goto out; + + udata->vfd_ref_count--; + + /* release the shared buffer only if indicated by the respective flag and there are no outstanding references */ + if (udata->fapl_ref_count == 0 && udata->vfd_ref_count == 0 && + !(udata->flags & H5LT_FILE_IMAGE_DONT_RELEASE)) { + HDfree(udata->vfd_image_ptr); + udata->app_image_ptr = NULL; + udata->fapl_image_ptr = NULL; + udata->vfd_image_ptr = NULL; + } /* end if */ + break; + + /* added unused labels to keep the compiler quite */ + case H5FD_FILE_IMAGE_OP_NO_OP: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY: + case H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET: + case H5FD_FILE_IMAGE_OP_FILE_OPEN: + case H5FD_FILE_IMAGE_OP_FILE_RESIZE: + default: + goto out; + } /* end switch */ + + return(SUCCEED); + +out: + return(FAIL); +} /* end image_free() */ + + +/*------------------------------------------------------------------------- +* Function: udata_copy +* +* Purpose: Simulates the copying of the user data structure utilized in the +* management of the "copying" of file images. +* +* Return: Address of "newly allocated" structure, if successful. Otherwise, it +* returns NULL. +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static void * +udata_copy(void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + if (udata->ref_count == 0) + goto out; + + udata->ref_count++; + + return(udata); + +out: + return NULL; +} /* end udata_copy */ + + +/*------------------------------------------------------------------------- +* Function: udata_free +* +* Purpose: Simulates deallocation of the user data structure utilized in the +* management of the "copying" of file images. The data structure is +* actually deallocated when there are no outstanding references. +* +* Return: SUCCEED or FAIL +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +static herr_t +udata_free(void *_udata) +{ + H5LT_file_image_ud_t *udata = (H5LT_file_image_ud_t *)_udata; + + /* callback is only used if the application buffer is not actually copied */ + if (!(udata->flags & H5LT_FILE_IMAGE_DONT_COPY)) + goto out; + if (udata->ref_count == 0) + goto out; + + udata->ref_count--; + + /* checks that there are no references outstanding before deallocating udata */ + if (udata->ref_count == 0 && udata->fapl_ref_count == 0 && + udata->vfd_ref_count == 0) + HDfree(udata); + + return(SUCCEED); + +out: + return(FAIL); +} /* end udata_free */ + +/* End of callbacks definitions for file image operations */ /*------------------------------------------------------------------------- * @@ -388,6 +843,120 @@ out: return -1; } + +/*------------------------------------------------------------------------- +* Function: H5LTopen_file_image +* +* Purpose: Open a user supplied file image using the core file driver. +* +* Return: File identifier, Failure: -1 +* +* Programmer: Christian Chilan +* +* Date: October 3, 2011 +* +*------------------------------------------------------------------------- +*/ +hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) +{ + hid_t fapl, file_id; /* HDF5 identifiers */ + unsigned file_open_flags;/* Flags for image open */ + char file_name[64]; /* Filename buffer */ + size_t alloc_incr; /* Buffer allocation increment */ + size_t min_incr = 65536; /* Minimum buffer increment */ + double buf_prcnt = 0.1f; /* Percentage of buffer size to set + as increment */ + static long file_name_counter; + H5FD_file_image_callbacks_t callbacks = {&image_malloc, &image_memcpy, + &image_realloc, &image_free, + &udata_copy, &udata_free, + (void *)NULL}; + + /* check arguments */ + if (buf_ptr == NULL) + goto out; + if (buf_size == 0) + goto out; + if (flags & (unsigned)~(H5LT_FILE_IMAGE_ALL)) + goto out; + + /* Create FAPL to transmit file image */ + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + goto out; + + /* set allocation increment to a percentage of the supplied buffer size, or + * a pre-defined minimum increment value, whichever is larger + */ + if ((buf_prcnt * buf_size) > min_incr) + alloc_incr = (size_t)(buf_prcnt * buf_size); + else + alloc_incr = min_incr; + + /* Configure FAPL to use the core file driver */ + if (H5Pset_fapl_core(fapl, alloc_incr, FALSE) < 0) + goto out; + + /* Set callbacks for file image ops ONLY if the file image is NOT copied */ + if (flags & H5LT_FILE_IMAGE_DONT_COPY) { + H5LT_file_image_ud_t *udata; /* Pointer to udata structure */ + + /* Allocate buffer to communicate user data to callbacks */ + if (NULL == (udata = (H5LT_file_image_ud_t *)HDmalloc(sizeof(H5LT_file_image_ud_t)))) + goto out; + + /* Initialize udata with info about app buffer containing file image and flags */ + udata->app_image_ptr = buf_ptr; + udata->app_image_size = buf_size; + udata->fapl_image_ptr = NULL; + udata->fapl_image_size = 0; + udata->fapl_ref_count = 0; + udata->vfd_image_ptr = NULL; + udata->vfd_image_size = 0; + udata->vfd_ref_count = 0; + udata->flags = flags; + udata->ref_count = 1; /* corresponding to the first FAPL */ + + /* copy address of udata into callbacks */ + callbacks.udata = (void *)udata; + + /* Set file image callbacks */ + if (H5Pset_file_image_callbacks(fapl, &callbacks) < 0) { + HDfree(udata); + goto out; + } /* end if */ + } /* end if */ + + /* Assign file image in user buffer to FAPL */ + if (H5Pset_file_image(fapl, buf_ptr, buf_size) < 0) + goto out; + + /* set file open flags */ + if (flags & H5LT_FILE_IMAGE_OPEN_RW) + file_open_flags = H5F_ACC_RDWR; + else + file_open_flags = H5F_ACC_RDONLY; + + /* define a unique file name */ + snprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); + + /* Assign file image in FAPL to the core file driver */ + if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) + goto out; + + /* Close FAPL */ + if (H5Pclose(fapl) < 0) + goto out; + + /* Return file identifier */ + return file_id; + +out: + H5E_BEGIN_TRY { + H5Pclose(fapl); + } H5E_END_TRY; + return -1; +} /* end H5LTopen_file_image() */ + /*------------------------------------------------------------------------- * Function: H5LT_read_dataset @@ -1801,7 +2370,7 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) out: if(0 == nmembs) { - HDsnprintf(tmp_str, TMP_LEN, "\n%*s ", indt + 4, ""); + HDsnprintf(tmp_str, TMP_LEN, "\n%*s ", (int)(indt + 4), ""); str = realloc_and_append(no_ubuf, str_len, str, tmp_str); } /* end if */ diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h index 6efae68..929c6bd 100644 --- a/hl/src/H5LTpublic.h +++ b/hl/src/H5LTpublic.h @@ -16,6 +16,15 @@ #ifndef _H5LTpublic_H #define _H5LTpublic_H +/* Flag definitions for H5LTopen_file_image() */ +#define H5LT_FILE_IMAGE_OPEN_RW 0x0001 /* Open image for read-write */ +#define H5LT_FILE_IMAGE_DONT_COPY 0x0002 /* The HDF5 lib won't copy */ +/* user supplied image buffer. The same image is open with the core driver. */ +#define H5LT_FILE_IMAGE_DONT_RELEASE 0x0004 /* The HDF5 lib won't */ +/* deallocate user supplied image buffer. The user application is reponsible */ +/* for doing so. */ +#define H5LT_FILE_IMAGE_ALL 0x0007 + typedef enum H5LT_lang_t { H5LT_LANG_ERR = -1, /*this is the first*/ H5LT_DDL = 0, /*for DDL*/ @@ -344,6 +353,15 @@ H5_HLDLL herr_t H5LTfind_attribute( hid_t loc_id, const char *name ); H5_HLDLL htri_t H5LTpath_valid(hid_t loc_id, const char *path, hbool_t check_object_valid); +/*------------------------------------------------------------------------- + * + * File image operations functions + * + *------------------------------------------------------------------------- + */ + +H5_HLDLL hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags); + #ifdef __cplusplus } #endif diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index 86e3318..76c6f90 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -29,7 +29,7 @@ LDADD=$(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) # Test programs. These are our main targets. They should be listed in the # order to be executed, generally most specific tests to least specific tests. -TEST_PROG=test_lite test_image test_table test_ds test_packet +TEST_PROG=test_lite test_image test_file_image test_table test_ds test_packet check_PROGRAMS=$(TEST_PROG) # These programs generate test files for the tests. They don't need to be @@ -45,7 +45,7 @@ endif # Temporary files. These files are the ones created by running `make test'. CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_image[1-3].h5 \ - test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ + file_img[1-2].h5 test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ test_packet_compress.h5 test_detach.h5 include $(top_srcdir)/config/conclude.am diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index 6aa5a2a..b7548ec 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -69,7 +69,8 @@ CONFIG_HEADER = $(top_builddir)/src/H5config.h CONFIG_CLEAN_FILES = H5srcdir_str.h CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test_lite$(EXEEXT) test_image$(EXEEXT) \ - test_table$(EXEEXT) test_ds$(EXEEXT) test_packet$(EXEEXT) + test_file_image$(EXEEXT) test_table$(EXEEXT) test_ds$(EXEEXT) \ + test_packet$(EXEEXT) am__EXEEXT_2 = gen_test_ds$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) gen_test_ds_SOURCES = gen_test_ds.c @@ -83,6 +84,10 @@ test_ds_SOURCES = test_ds.c test_ds_OBJECTS = test_ds.$(OBJEXT) test_ds_LDADD = $(LDADD) test_ds_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) +test_file_image_SOURCES = test_file_image.c +test_file_image_OBJECTS = test_file_image.$(OBJEXT) +test_file_image_LDADD = $(LDADD) +test_file_image_DEPENDENCIES = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) test_image_SOURCES = test_image.c test_image_OBJECTS = test_image.$(OBJEXT) test_image_LDADD = $(LDADD) @@ -125,10 +130,10 @@ am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_$(V)) am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) am__v_GEN_0 = @echo " GEN " $@; -SOURCES = gen_test_ds.c test_ds.c test_image.c test_lite.c \ - test_packet.c test_table.c -DIST_SOURCES = gen_test_ds.c test_ds.c test_image.c test_lite.c \ - test_packet.c test_table.c +SOURCES = gen_test_ds.c test_ds.c test_file_image.c test_image.c \ + test_lite.c test_packet.c test_table.c +DIST_SOURCES = gen_test_ds.c test_ds.c test_file_image.c test_image.c \ + test_lite.c test_packet.c test_table.c ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -422,16 +427,16 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. These files are the ones created by running `make test'. CHECK_CLEANFILES = *.chkexe *.chklog *.clog combine_tables[1-2].h5 \ - test_ds[1-9].h5 test_image[1-3].h5 test_lite[1-2].h5 \ - test_table.h5 test_packet_table.h5 test_packet_compress.h5 \ - test_detach.h5 + test_ds[1-9].h5 test_image[1-3].h5 file_img[1-2].h5 \ + test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ + test_packet_compress.h5 test_detach.h5 # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) # Test programs. These are our main targets. They should be listed in the # order to be executed, generally most specific tests to least specific tests. -TEST_PROG = test_lite test_image test_table test_ds test_packet +TEST_PROG = test_lite test_image test_file_image test_table test_ds test_packet # These programs generate test files for the tests. They don't need to be # compiled every time we want to test the library. However, putting @@ -515,6 +520,9 @@ gen_test_ds$(EXEEXT): $(gen_test_ds_OBJECTS) $(gen_test_ds_DEPENDENCIES) test_ds$(EXEEXT): $(test_ds_OBJECTS) $(test_ds_DEPENDENCIES) @rm -f test_ds$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_ds_OBJECTS) $(test_ds_LDADD) $(LIBS) +test_file_image$(EXEEXT): $(test_file_image_OBJECTS) $(test_file_image_DEPENDENCIES) + @rm -f test_file_image$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(test_file_image_OBJECTS) $(test_file_image_LDADD) $(LIBS) test_image$(EXEEXT): $(test_image_OBJECTS) $(test_image_DEPENDENCIES) @rm -f test_image$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_image_OBJECTS) $(test_image_LDADD) $(LIBS) @@ -536,6 +544,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_test_ds.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ds.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_lite.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_packet.Po@am__quote@ diff --git a/hl/test/h5hltest.h b/hl/test/h5hltest.h index 466a0e1..809c4ec 100644 --- a/hl/test/h5hltest.h +++ b/hl/test/h5hltest.h @@ -23,9 +23,6 @@ #ifndef _H5HLTEST_H #define _H5HLTEST_H -/* Get the HDF5 public header */ -#include "hdf5.h" - /* Get the HDF5 test header */ #include "h5test.h" @@ -36,5 +33,8 @@ #define TESTING2(WHAT) {printf("%-70s", "Testing " WHAT); fflush(stdout);} #define TESTING3(WHAT) {printf("%-70s", "" WHAT); fflush(stdout);} +/* Implrements verbose 'assert' with 'goto error' exit */ +#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0) + #endif /* _H5HLTEST_H */ diff --git a/hl/test/test_file_image.c b/hl/test/test_file_image.c new file mode 100644 index 0000000..9729421 --- /dev/null +++ b/hl/test/test_file_image.c @@ -0,0 +1,518 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * +* Copyright by The HDF Group. * +* 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * +* access to either file, you may request a copy from help@hdfgroup.org. * +* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "h5hltest.h" +#include "H5LTpublic.h" + +#define DSET_NAME "dset" + +#define RANK 2 + +/* Test of file image operations. + + The following code provides a means to thoroughly test the file image + operations. Main objectives are testing operations with multiple open + images and using all possible flag combinations, which are set in the + main calling routine. Since the number of open images and flag combinations + may differ, the flag combinations are assigned to the images in round-robin + fashion. In order to simulate a realistic operation environment, the code + operates on as many open objects as possible by using several for-loops + instead of using a single loop that opens image i, accesses it, and closes + it. The first loop creates the files and obtains images using the function + H5Fget_file_image(); two images are set incorrectly (one image is filled + with "wrong" data while the other image is not valid). The second loop opens + the images using the function H5LTopen_file_image(), and test whether the + images have been copied in accordance to the H5LT_FILE_IMAGE_DONT_COPY flag. + The third loop reads the open images and verifies that the contents are + correct. The fourth loop first perform writes in the images that do not + extend the image, and then performs writes that extend the images. The fifth + loop reads the extended images and verify that the content are correct. The + sixth and final loop closes the file images and deallocates the image + buffers if appropriate. */ + +/*------------------------------------------------------------------------- +* test file image operations +*------------------------------------------------------------------------- +*/ +static int +test_file_image(size_t open_images, size_t nflags, unsigned *flags) +{ + hid_t *file_id, *dset_id, file_space, plist; /* HDF5 ids */ + hsize_t dims1[RANK] = {2,3}; /* original dimension of datasets */ + hsize_t max_dims[RANK] = {H5S_UNLIMITED, H5S_UNLIMITED}; + int data1[6] = {1,2,3,4,5,6}; /* original contents of dataset */ + int data2[6] = {7,8,9,10,11,12}; /* "wrong" contents of dataset */ + hsize_t dims3[RANK]; /* array to read dataset dimensions */ + int data3[15]; /* array to read dataset contents */ + hsize_t dims4[RANK] = {3,5}; /* extended dimensions of datasets */ + int data4[15] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15}; + /* extended contents of dataset */ + ssize_t *buf_size; /* pointer to array of buffer sizes */ + void **buf_ptr; /* pointer to array of pointers to image buffers */ + char **filename; /* pointer to array of pointers to filenames */ + unsigned *input_flags; /* pointer to array of flag combinations */ + size_t i, j, k, nrow, n_values; + herr_t status1; + void *handle_ptr = NULL; /* pointers to driver buffer */ + unsigned char **core_buf_ptr_ptr = NULL; + + VERIFY(open_images > 1 , "The number of open images must be greater than 1"); + + VERIFY(nflags > 0, "The number of flag combinations must be greater than 0"); + + /* allocate array of flags for open images */ + if (NULL == (input_flags = (unsigned *)HDmalloc(sizeof(unsigned) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* allocate array of pointers for each of the open images */ + if (NULL == (buf_ptr = (void **)malloc(sizeof(void *) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* allocate array to store the name of each of the open images */ + if (NULL == (filename = (char **)malloc(sizeof(char *) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* allocate array to store the size of each of the open images */ + if (NULL == (buf_size = (ssize_t *)malloc(sizeof(ssize_t) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* allocate array for each of the file identifiers */ + if (NULL == (file_id = (hid_t *)malloc(sizeof(hid_t) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* allocate array for each of the dataset identifiers */ + if (NULL == (dset_id = (hid_t *)malloc(sizeof(hid_t) * open_images))) + FAIL_PUTS_ERROR("malloc() failed"); + + TESTING("get file images"); + + /* create several file images */ + for (i = 0; i < open_images; i++) { + + /* populate array for flags combinations */ + input_flags[i] = flags[(nflags + i) % nflags]; + + /* allocate name buffer for image i */ + filename[i] = (char *)HDmalloc(sizeof(char) * 32); + + /* create file name */ + sprintf(filename[i], "image_file%d.h5", (int)i); + + /* create file */ + if ((file_id[i] = H5Fcreate(filename[i], H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("H5Fcreate() failed"); + + /* define dataspace for the dataset */ + if ((file_space = H5Screate_simple(RANK, dims1, max_dims)) < 0) + FAIL_PUTS_ERROR("H5Screate_simple() failed"); + + /* create dataset property list */ + if ((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0) + FAIL_PUTS_ERROR("H5Pcreate() failed"); + + /* set property list to create chunked dataset */ + if (H5Pset_chunk(plist, RANK, dims1) < 0) + FAIL_PUTS_ERROR("H5Pset_chunk() failed"); + + /* create and write an integer type dataset named "dset" */ + if ((dset_id[i] = H5Dcreate2(file_id[i], DSET_NAME, H5T_NATIVE_INT, file_space, H5P_DEFAULT, plist, H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("H5Dcreate() failed"); + + /* dataset in open image 1 is written with "wrong" data */ + if (i == 1) { + if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2) < 0) + FAIL_PUTS_ERROR("H5Dwrite() failed"); + } /* end if*/ + /* dataset in the rest of the open images is written with correct data */ + else { + if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0) + FAIL_PUTS_ERROR("H5Dwrite() failed"); + } /* end else */ + + /* flush into the file */ + if (H5Fflush(file_id[i], H5F_SCOPE_LOCAL) < 0) + FAIL_PUTS_ERROR("H5Fflush() failed"); + + /* close dataset property list */ + if (H5Pclose(plist) < 0) + FAIL_PUTS_ERROR("H5Pclose() failed"); + + /* close dataspace */ + if (H5Sclose(file_space) < 0) + FAIL_PUTS_ERROR("H5Sclose() failed"); + + /* close dataset */ + if (H5Dclose(dset_id[i]) < 0) + FAIL_PUTS_ERROR("H5Dclose() failed"); + + /* get size of the file image i */ + if ((buf_size[i] = H5Fget_file_image(file_id[i], NULL, 0)) < 0) + FAIL_PUTS_ERROR("H5Fget_file_image() failed"); + + /* allocate buffer for the file image i */ + if (NULL == (buf_ptr[i] = (void *)HDmalloc((size_t)buf_size[i]))) + FAIL_PUTS_ERROR("malloc() failed"); + + /* buffer for file image 2 is filled with counter data (non-valid image) */ + if (i == 2) { + for (j = 0; j < (size_t)buf_size[i]; j++) + ((char*)(buf_ptr[i]))[j] = (char)j; + } /* end if */ + /* buffers for the rest of the file images are filled with data from the respective files */ + else { + if ((buf_size[i] = H5Fget_file_image(file_id[i], buf_ptr[i], (size_t)buf_size[i])) < 0) + FAIL_PUTS_ERROR("H5Fget_file_image() failed"); + } /* end else */ + + /* file close */ + if (H5Fclose (file_id[i]) < 0) + FAIL_PUTS_ERROR("H5Fclose() failed"); + } /* end for */ + + PASSED(); + + TESTING("open file images and check image copies"); + + /* open the file images with the core driver for data access */ + for (i = 0; i < open_images; i++) { + /* open file image 2 filled with counter data (non-valid image) */ + if (i == 2) { + H5E_BEGIN_TRY { + /* attempt to set file image in the core driver */ + file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i]); + } H5E_END_TRY + + VERIFY(file_id[i] < 0, "H5LTopen_file_image() should have failed"); + } /* end if */ + /* open rest of valid file images */ + else { + /* set file image in the core driver */ + if ((file_id[i] = H5LTopen_file_image(buf_ptr[i], (size_t)buf_size[i], input_flags[i])) < 0) + FAIL_PUTS_ERROR("H5LTopen_file_image() failed"); + + /* get pointer to the image buffer of the core driver */ + if (H5Fget_vfd_handle(file_id[i], H5P_DEFAULT, &handle_ptr) < 0) + FAIL_PUTS_ERROR("H5Fget_vfd_handle() failed"); + + core_buf_ptr_ptr = (unsigned char **)handle_ptr; + + /* test whether the user buffer has been copied or not */ + if (input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) + VERIFY(*core_buf_ptr_ptr == buf_ptr[i], "vfd buffer and user buffer should have been the same"); + else + VERIFY(*core_buf_ptr_ptr != buf_ptr[i], "vfd buffer and user buffer should be different"); + + /* test whether the contents of the user buffer and driver buffer */ + /* are equal. */ + if (HDmemcmp(*core_buf_ptr_ptr, buf_ptr[i], (size_t)buf_size[i]) != 0) + FAIL_PUTS_ERROR("comparison of vfd and user buffer failed"); + } /* end else */ + } /* end for */ + + PASSED(); + + TESTING("read file images"); + + /* read open file images and verify data */ + for (i = 0; i < open_images; i++) { + /* if opening the file image failed, continue next iteration */ + if (file_id[i] < 0) { + HDassert(i == 2); + continue; + } /* end if */ + + /* open dataset in file image */ + if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("H5Dopen() failed"); + + /* get dataspace for the dataset */ + if ((file_space = H5Dget_space(dset_id[i])) < 0) + FAIL_PUTS_ERROR("H5Dget_space() failed"); + + /* get dimensions for the dataset */ + if (H5Sget_simple_extent_dims(file_space, dims3, NULL) < 0) + FAIL_PUTS_ERROR("H5Sget_simple_extent_dims() failed"); + + /* read dataset */ + if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0) + FAIL_PUTS_ERROR("H5Dread() failed"); + + /* compute number of elements in dataset */ + n_values = (size_t)(dims3[0] * dims3[1]); + + /* determine the number of rows in dataset */ + nrow = (size_t)dims3[1]; + + /* verify contents for file image 1 with "wrong" data */ + if (i == 1) { + /* compare file image values with original data */ + for (j = 0; j < n_values / nrow; j++) + for (k = 0; k < nrow; k++) + if (data3[j * nrow + k ] == data1[j * nrow + k ]) + FAIL_PUTS_ERROR("comparison of image values with original data should have failed"); + } /* end if */ + /* verify contents for the rest of the file images */ + else { + /* compare file image values with original data */ + for (j = 0; j < n_values / nrow; j++) + for (k = 0; k < nrow; k++) + if (data3[j * nrow + k ] != data1[j * nrow + k ]) + FAIL_PUTS_ERROR("comparison of image values with original data failed"); + } /* end else */ + + /* close dataspace */ + if (H5Sclose (file_space) < 0) + FAIL_PUTS_ERROR("H5Sclose() failed"); + } /* end for */ + + PASSED(); + + TESTING("write and extend file images"); + + /* write open file images and verify data */ + for (i = 0; i < open_images; i++) { + /* if opening the file image failed, continue next iteration */ + if (file_id[i] < 0) { + HDassert(i == 2); + continue; + } /* end if */ + + /* test data write when file image access is read-only */ + if (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW)) { + /* write dataset without extending it */ + H5E_BEGIN_TRY { + status1 = H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1); + } H5E_END_TRY; + + VERIFY(status1 < 0, "H5Dwrite() should have failed"); + + /* extend dimensions of dataset */ + H5E_BEGIN_TRY { + status1 = H5Dset_extent(dset_id[i], dims4); + } H5E_END_TRY; + + VERIFY(status1 < 0, "H5Dset_extent() should have failed"); + + /* write extended dataset */ + H5E_BEGIN_TRY { + status1 = H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data4); + } H5E_END_TRY; + + VERIFY(status1 < 0, "H5Dwrite() should have failed"); + + /* close dataset */ + if (H5Dclose(dset_id[i]) < 0) + FAIL_PUTS_ERROR("H5Dclose() failed"); + } /* end if */ + /* test data write where file image access is read-write */ + else { + if ((input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) && (input_flags[i] & H5LT_FILE_IMAGE_DONT_RELEASE)) { +/* This test is disabled currently, since the new attribute causes the file + * to increase in size, but the realloc call in H5FD_core_write() fails, causing + * the flush operation to fail and the file to fail to close, eventually + * triggering the "infinite loop shutting down the library" problem. + * + * In theory, we could address this through a variety of methods, ranging from + * ignoring failures in H5F_dest() (when called from H5F_try_close()), to + * allocating space more aggressively when creating the attribute, etc. + * + * For now, we will just leave the test commented out and assume that + * application developers who mark their file image as "don't copy" won't + * be likely candidates for modifying their data. - QAK - March 29, 2012 + */ +#if 0 + int attr_rank = 1; + hsize_t attr_dims[] = {4096}; + int attr_data[4096]; + hid_t attr_space_id = -1; + hid_t attr_id = -1; + herr_t status2; + size_t l; + + if ((attr_space_id = H5Screate_simple(attr_rank, attr_dims, attr_dims)) < 0) + FAIL_PUTS_ERROR("attr_space H5Screate_simple() failed"); + + if((attr_id = H5Acreate_by_name(dset_id[i], ".", "int array_addr", H5T_NATIVE_INT, attr_space_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("H5Acreate_by_name() failed"); + + for(l = 0; l < 4096; l++) + attr_data[l] = (int)l; + + /* write data to the attribute and then flush the file. One or the other should + * should trigger an extension to the EOA, which in turn should cause the realloc + * callback to fail. + */ + H5E_BEGIN_TRY { + status1 = status2 = -1; + + status1 = H5Awrite(attr_id, H5T_NATIVE_INT, (const void *)attr_data); + if(status1 >= 0) + status2 = H5Fflush(file_id[i], H5F_SCOPE_GLOBAL); + + VERIFY(status1 < 0 || status2 < 0, "writing and flushing attr should have failed"); + } H5E_END_TRY; + + /* close attr and attr_space -- expect errors on close */ + H5E_BEGIN_TRY { + H5Sclose(attr_space_id); + H5Aclose(attr_id); + } H5E_END_TRY; +#endif + file_id[i] = -1; + } /* end if */ + else { + /* write dataset without extending it */ + if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data1) < 0) + FAIL_PUTS_ERROR("H5Dwrite() failed"); + + /* extend dimensions of dataset */ + if (H5Dset_extent(dset_id[i], dims4) < 0) + FAIL_PUTS_ERROR("H5Dset_extent() failed"); + + /* write extended dataset */ + if (H5Dwrite(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data4) < 0) + FAIL_PUTS_ERROR("H5Dwrite() failed"); + + /* close dataset */ + if (H5Dclose(dset_id[i]) < 0) + FAIL_PUTS_ERROR("H5Dclose() failed"); + } /* end else */ + } /* end else */ + } /* end for */ + + PASSED(); + + TESTING("read extended file images"); + + /* read open file images and verify data */ + for (i = 0; i < open_images; i++) { + /* if opening the file image failed, continue next iteration */ + if ((file_id[i] < 0) || (!(input_flags[i] & H5LT_FILE_IMAGE_OPEN_RW ))) + continue; + + /* open dataset in file image */ + if ((dset_id[i] = H5Dopen2(file_id[i], DSET_NAME, H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("H5Dopen() failed"); + + /* get dataspace for the dataset */ + if ((file_space = H5Dget_space(dset_id[i])) < 0) + FAIL_PUTS_ERROR("H5Dget_space() failed"); + + /* get dimensions for the dataset */ + if (H5Sget_simple_extent_dims(file_space, dims3, NULL) < 0) + FAIL_PUTS_ERROR("H5Sget_simple_extent_dims() failed"); + + /* read dataset */ + if (H5Dread(dset_id[i], H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data3) < 0) + FAIL_PUTS_ERROR("H5Dread() failed"); + + /* compute number of elements in dataset */ + n_values = (size_t)(dims3[0] * dims3[1]); + + /* determine the number of rows in dataset */ + nrow = (size_t)dims3[1]; + + /* verify contents for the file images */ + for (j = 0; j < n_values / nrow; j++) + for (k = 0; k < nrow; k++) + if (data3[j * nrow + k ] != data4[j * nrow + k ]) + FAIL_PUTS_ERROR("comparison of image values with original data failed"); + + /* close dataspace */ + if (H5Sclose (file_space) < 0) + FAIL_PUTS_ERROR("H5Sclose() failed"); + + /* close dataset */ + if (H5Dclose(dset_id[i]) < 0) + FAIL_PUTS_ERROR("H5Dclose() failed"); + } /* end for */ + + PASSED() + + TESTING("close file images"); + + /* close file images and release buffer if appropriate */ + for (i = 0; i < open_images; i++) { + /* close file is appropriate */ + if (file_id[i] >= 0) { + /* close file image */ + if (H5Fclose(file_id[i]) < 0) + FAIL_PUTS_ERROR("H5Fclose() failed"); + } /* end if */ + + /* delete test data files */ + if (HDremove(filename[i]) < 0) + FAIL_PUTS_ERROR("HDremove() failed"); + + /* free shared buffer if appropriate */ + if (!(input_flags[i] & H5LT_FILE_IMAGE_DONT_COPY) || (input_flags[i] & H5LT_FILE_IMAGE_DONT_RELEASE)) { + VERIFY(buf_ptr[i] != NULL, "buffer pointer must be non NULL"); + HDfree(buf_ptr[i]); + } /* end if */ + + } /* end for */ + + /* release temporary working buffers */ + HDfree(filename); + HDfree(file_id); + HDfree(dset_id); + HDfree(buf_ptr); + HDfree(buf_size); + HDfree(input_flags); + + PASSED(); + + H5close(); + + return 0; + +error: + H5_FAILED(); + return -1; +} + +/*------------------------------------------------------------------------- +* the main program +*------------------------------------------------------------------------- +*/ +int main( void ) +{ + int nerrors = 0; + size_t open_images = 10; /* number of open file images */ + size_t nflags = 8; /* number of flag combinations */ + unsigned flags[8]; /* array with flag combinations */ + + /* set flag combinations for testing */ + flags[0] = 0; + flags[1] = H5LT_FILE_IMAGE_DONT_RELEASE; + flags[2] = H5LT_FILE_IMAGE_DONT_COPY; + flags[3] = H5LT_FILE_IMAGE_DONT_COPY | H5LT_FILE_IMAGE_DONT_RELEASE; + flags[4] = H5LT_FILE_IMAGE_OPEN_RW; + flags[5] = H5LT_FILE_IMAGE_OPEN_RW | H5LT_FILE_IMAGE_DONT_RELEASE; + flags[6] = H5LT_FILE_IMAGE_OPEN_RW | H5LT_FILE_IMAGE_DONT_COPY; + flags[7] = H5LT_FILE_IMAGE_OPEN_RW | H5LT_FILE_IMAGE_DONT_COPY | H5LT_FILE_IMAGE_DONT_RELEASE; + + /* Test file image operations. The flag combinations are assigned to file images in round-robin fashion */ + nerrors += test_file_image(open_images, nflags, flags) < 0? 1 : 0; + + if (nerrors) goto error; + printf("File image tests passed.\n"); + return 0; + +error: + printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S"); + return 1; +} + diff --git a/src/H5Dint.c b/src/H5Dint.c index 5c905bb..28d5367 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -2436,7 +2436,8 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) udata.dxpl_id = dxpl_id; /* Iterate over all the open datasets */ - H5I_search(H5I_DATASET, H5D_flush_cb, &udata, FALSE); + if(H5I_iterate(H5I_DATASET, H5D_flush_cb, &udata, FALSE) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info") done: FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5E.c b/src/H5E.c index 4e14887..e74211e 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -107,7 +107,7 @@ static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, const char *version); static herr_t H5E_unregister_class(H5E_cls_t *cls); static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size); -static int H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key); +static int H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *udata); static herr_t H5E_close_msg(H5E_msg_t *err); static H5E_msg_t *H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg); static H5E_t *H5E_get_current_stack(void); @@ -543,8 +543,8 @@ H5E_unregister_class(H5E_cls_t *cls) HDassert(cls); /* Iterate over all the messages and delete those in this error class */ - /* (Ignore return value, since callback isn't designed to return a particular object) */ - (void)H5I_search(H5I_ERROR_MSG, H5E_close_msg_cb, cls, FALSE); + if(H5I_iterate(H5I_ERROR_MSG, H5E_close_msg_cb, cls, FALSE) < 0) + HGOTO_ERROR(H5E_ERROR, H5E_BADITER, FAIL, "unable to free all messages in this error class") /* Free error class structure */ if(H5E_free_class(cls) < 0) @@ -631,7 +631,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) /*------------------------------------------------------------------------- * Function: H5E_close_msg_cb * - * Purpose: H5I_search callback function to close error messages in the + * Purpose: H5I_iterate callback function to close error messages in the * error class. * * Return: Non-negative value on success/Negative on failure @@ -642,10 +642,10 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) *------------------------------------------------------------------------- */ static int -H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) +H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *udata) { H5E_msg_t *err_msg = (H5E_msg_t*)obj_ptr; - H5E_cls_t *cls = (H5E_cls_t*)key; + H5E_cls_t *cls = (H5E_cls_t*)udata; herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5Edefin.h b/src/H5Edefin.h index 887c2bb..ee284c4 100644 --- a/src/H5Edefin.h +++ b/src/H5Edefin.h @@ -93,6 +93,7 @@ hid_t H5E_CANTRELEASE_g = FAIL; /* Unable to release object */ hid_t H5E_CANTGET_g = FAIL; /* Can't get value */ hid_t H5E_CANTSET_g = FAIL; /* Can't set value */ hid_t H5E_DUPCLASS_g = FAIL; /* Duplicate class name in parent class */ +hid_t H5E_SETDISALLOWED_g = FAIL; /* Disallowed operation */ /* Free space errors */ hid_t H5E_CANTMERGE_g = FAIL; /* Can't merge objects */ diff --git a/src/H5Einit.h b/src/H5Einit.h index 802c94a..6881e48 100644 --- a/src/H5Einit.h +++ b/src/H5Einit.h @@ -339,6 +339,11 @@ if((msg = H5E_create_msg(cls, H5E_MINOR, "Duplicate class name in parent class") HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") if((H5E_DUPCLASS_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") +assert(H5E_SETDISALLOWED_g==(-1)); +if((msg = H5E_create_msg(cls, H5E_MINOR, "Disallowed operation"))==NULL) + HGOTO_ERROR(H5E_ERROR, H5E_CANTINIT, FAIL, "error message initialization failed") +if((H5E_SETDISALLOWED_g = H5I_register(H5I_ERROR_MSG, msg, FALSE))<0) + HGOTO_ERROR(H5E_ERROR, H5E_CANTREGISTER, FAIL, "can't register error message") /* Free space errors */ assert(H5E_CANTMERGE_g==(-1)); diff --git a/src/H5Epubgen.h b/src/H5Epubgen.h index f6a20f2..967b248 100644 --- a/src/H5Epubgen.h +++ b/src/H5Epubgen.h @@ -155,9 +155,11 @@ H5_DLLVAR hid_t H5E_CANTRELEASE_g; /* Unable to release object */ #define H5E_CANTGET (H5OPEN H5E_CANTGET_g) #define H5E_CANTSET (H5OPEN H5E_CANTSET_g) #define H5E_DUPCLASS (H5OPEN H5E_DUPCLASS_g) +#define H5E_SETDISALLOWED (H5OPEN H5E_SETDISALLOWED_g) H5_DLLVAR hid_t H5E_CANTGET_g; /* Can't get value */ H5_DLLVAR hid_t H5E_CANTSET_g; /* Can't set value */ H5_DLLVAR hid_t H5E_DUPCLASS_g; /* Duplicate class name in parent class */ +H5_DLLVAR hid_t H5E_SETDISALLOWED_g; /* Disallowed operation */ /* Free space errors */ #define H5E_CANTMERGE (H5OPEN H5E_CANTMERGE_g) diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 921b3b6..5edcd34 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -94,7 +94,8 @@ H5E_CANTRELEASE_g= /* Property list errors */ H5E_CANTGET_g= H5E_CANTSET_g= -H5E_DUPCLASS_g= +H5E_DUPCLASS_g= +H5E_SETDISALLOWED_g= /* Free space errors */ H5E_CANTMERGE_g= diff --git a/src/H5F.c b/src/H5F.c index b4f1191..cdf418b 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -52,7 +52,7 @@ typedef struct H5F_olist_t { } H5F_olist_t; /* PRIVATE PROTOTYPES */ -static size_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_objs, hid_t *obj_id_list, hbool_t app_ref); +static herr_t H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr); static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id, H5FD_t *lf); @@ -363,11 +363,6 @@ done: * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 - * Modification: - * Raymond Lu - * 24 September 2008 - * Changed the return value to ssize_t to accommadate - * potential large number of objects. * *------------------------------------------------------------------------- */ @@ -375,18 +370,24 @@ ssize_t H5Fget_obj_count(hid_t file_id, unsigned types) { H5F_t *f = NULL; /* File to query */ - ssize_t ret_value; /* Return value */ + size_t obj_count = 0; /* Number of opened objects */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE2("Zs", "iIu", file_id, types); + /* Check arguments */ if(file_id != (hid_t)H5F_OBJ_ALL && (NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file id") if(0 == (types & H5F_OBJ_ALL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not an object type") - /* H5F_get_obj_count doesn't fail */ - ret_value = (ssize_t)H5F_get_obj_count(f, types, TRUE); + /* Perform the query */ + if(H5F_get_obj_count(f, types, TRUE, &obj_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_count failed") + + /* Set the return value */ + ret_value = (ssize_t)obj_count; done: FUNC_LEAVE_API(ret_value) @@ -399,31 +400,30 @@ done: * Purpose: Private function return the number of opened object IDs * (files, datasets, groups, datatypes) in the same file. * - * Return: Non-negative on success; can't fail. + * Return: SUCCEED on success, FAIL on failure. * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * - * Modification: - * Raymond Lu - * 24 September 2008 - * Changed the return value to size_t to accommadate - * potential large number of objects. - * *------------------------------------------------------------------------- */ -size_t -H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref) +herr_t +H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref, size_t *obj_id_count_ptr) { - size_t ret_value; /* Return value */ + herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(obj_id_count_ptr); - /* H5F_get_objects doesn't fail */ - ret_value = H5F_get_objects(f, types, 0, NULL, app_ref); + /* Perform the query */ + if((ret_value = H5F_get_objects(f, types, 0, NULL, app_ref, obj_id_count_ptr)) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_objects failed") +done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5F_get_obj_count() */ /*------------------------------------------------------------------------- @@ -448,19 +448,25 @@ ssize_t H5Fget_obj_ids(hid_t file_id, unsigned types, size_t max_objs, hid_t *oid_list) { H5F_t *f = NULL; /* File to query */ - ssize_t ret_value; /* Return value */ + size_t obj_id_count = 0; /* Number of open objects */ + ssize_t ret_value; /* Return value */ FUNC_ENTER_API(FAIL) H5TRACE4("Zs", "iIuz*i", file_id, types, max_objs, oid_list); + /* Check arguments */ if(file_id != (hid_t)H5F_OBJ_ALL && (NULL == (f = (H5F_t *)H5I_object_verify(file_id, H5I_FILE)))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file id") if(0 == (types & H5F_OBJ_ALL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not an object type") HDassert(oid_list); - /* H5F_get_objects doesn't fail */ - ret_value = (ssize_t)H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE); + /* Perform the query */ + if(H5F_get_obj_ids(f, types, max_objs, oid_list, TRUE, &obj_id_count) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_ids failed") + + /* Set the return value */ + ret_value = (ssize_t)obj_id_count; done: FUNC_LEAVE_API(ret_value) @@ -477,26 +483,25 @@ done: * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * - * Modification: - * Raymond Lu - * 24 September 2008 - * Changed the return value and MAX_OBJTS to size_t to accommadate - * potential large number of objects. - * *------------------------------------------------------------------------- */ -size_t -H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, hbool_t app_ref) +herr_t +H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, hbool_t app_ref, size_t *obj_id_count_ptr) { - size_t ret_value; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI(FAIL) + + /* Sanity check */ + HDassert(obj_id_count_ptr); - /* H5F_get_objects doesn't fail */ - ret_value = H5F_get_objects(f, types, max_objs, oid_list, app_ref); + /* Perform the query */ + if((ret_value = H5F_get_objects(f, types, max_objs, oid_list, app_ref, obj_id_count_ptr)) < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_objects failed") +done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5F_get_obj_ids() */ /*--------------------------------------------------------------------------- @@ -512,14 +517,18 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list * *--------------------------------------------------------------------------- */ -static size_t -H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref) +static herr_t +H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_list, hbool_t app_ref, size_t *obj_id_count_ptr) { size_t obj_id_count=0; /* Number of open IDs */ H5F_olist_t olist; /* Structure to hold search results */ - size_t ret_value; /* Return value */ + htri_t type_exists; /* Whether objects of a type are open */ + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_NOAPI_NOINIT + + /* Sanity check */ + HDassert(obj_id_count_ptr); /* Set up search information */ olist.obj_id_list = (max_index==0 ? NULL : obj_id_list); @@ -537,45 +546,50 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_ olist.file_info.ptr.shared = f ? f->shared : NULL; } /* end else */ - /* Search through file IDs to count the number, and put their - * IDs on the object list. H5I_search returns NULL if no object - * is found, so don't return failure in this function. */ + /* Iterate through file IDs to count the number, and put their + * IDs on the object list. */ if(types & H5F_OBJ_FILE) { olist.obj_type = H5I_FILE; - (void)H5I_search(H5I_FILE, H5F_get_objects_cb, &olist, app_ref); + if(H5I_iterate(H5I_FILE, H5F_get_objects_cb, &olist, app_ref) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(1)") } /* end if */ /* Search through dataset IDs to count number of datasets, and put their * IDs on the object list */ if(types & H5F_OBJ_DATASET) { olist.obj_type = H5I_DATASET; - (void)H5I_search(H5I_DATASET, H5F_get_objects_cb, &olist, app_ref); - } + if(H5I_iterate(H5I_DATASET, H5F_get_objects_cb, &olist, app_ref) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(2)") + } /* end if */ /* Search through group IDs to count number of groups, and put their * IDs on the object list */ if(types & H5F_OBJ_GROUP) { olist.obj_type = H5I_GROUP; - (void)H5I_search(H5I_GROUP, H5F_get_objects_cb, &olist, app_ref); - } + if(H5I_iterate(H5I_GROUP, H5F_get_objects_cb, &olist, app_ref) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(3)") + } /* end if */ /* Search through datatype IDs to count number of named datatypes, and put their * IDs on the object list */ if(types & H5F_OBJ_DATATYPE) { olist.obj_type = H5I_DATATYPE; - (void)H5I_search(H5I_DATATYPE, H5F_get_objects_cb, &olist, app_ref); - } + if(H5I_iterate(H5I_DATATYPE, H5F_get_objects_cb, &olist, app_ref) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(4)") + } /* end if */ /* Search through attribute IDs to count number of attributes, and put their * IDs on the object list */ if(types & H5F_OBJ_ATTR) { olist.obj_type = H5I_ATTR; - (void)H5I_search(H5I_ATTR, H5F_get_objects_cb, &olist, app_ref); - } + if(H5I_iterate(H5I_ATTR, H5F_get_objects_cb, &olist, app_ref) < 0) + HGOTO_ERROR(H5E_FILE, H5E_BADITER, FAIL, "iteration failed(5)") + } /* end if */ /* Set the number of objects currently open */ - ret_value = obj_id_count; + *obj_id_count_ptr = obj_id_count; +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_get_objects() */ @@ -593,8 +607,6 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_ * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * - * Modification: - * *------------------------------------------------------------------------- */ static int @@ -626,8 +638,8 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) /* Check if we've filled up the array. Return TRUE only if * we have filled up the array. Otherwise return FALSE(RET_VALUE is - * preset to FALSE) because H5I_search needs the return value of FALSE - * to continue searching. */ + * preset to FALSE) because H5I_iterate needs the return value of + * FALSE to continue the iteration. */ if(olist->max_index>0 && olist->list_index>=olist->max_index) HGOTO_DONE(TRUE) /* Indicate that the iterator should stop */ } @@ -691,8 +703,8 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) /* Check if we've filled up the array. Return TRUE only if * we have filled up the array. Otherwise return FALSE(RET_VALUE is - * preset to FALSE) because H5I_search needs the return value of FALSE - * to continue searching. */ + * preset to FALSE) because H5I_iterate needs the return value of + * FALSE to continue iterating. */ if(olist->max_index>0 && olist->list_index>=olist->max_index) HGOTO_DONE(TRUE) /* Indicate that the iterator should stop */ } /* end if */ @@ -1785,8 +1797,6 @@ done: * Programmer: Quincey Koziol * Tuesday, July 19, 2005 * - * Modifications: - * *------------------------------------------------------------------------- */ herr_t @@ -1868,27 +1878,36 @@ H5F_try_close(H5F_t *f) if(f->nopen_objs > 0) { size_t obj_count; /* # of open objects */ hid_t objs[128]; /* Array of objects to close */ + herr_t result; /* Local result from obj ID query */ size_t u; /* Local index variable */ /* Get the list of IDs of open dataset, group, & attribute objects */ - while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs, FALSE)) != 0) { + while((result = H5F_get_obj_ids(f, H5F_OBJ_LOCAL | H5F_OBJ_DATASET | H5F_OBJ_GROUP | H5F_OBJ_ATTR, (int)(sizeof(objs) / sizeof(objs[0])), objs, FALSE, &obj_count)) <= 0 + && obj_count != 0 ) { + /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) if(H5I_dec_ref(objs[u]) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object") } /* end while */ + if(result < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_ids failed(1)") /* Get the list of IDs of open named datatype objects */ /* (Do this separately from the dataset & attribute IDs, because * they could be using one of the named datatypes and then the * open named datatype ID will get closed twice) */ - while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATATYPE, (int)(sizeof(objs)/sizeof(objs[0])), objs, FALSE)) != 0) { + while((result = H5F_get_obj_ids(f, H5F_OBJ_LOCAL | H5F_OBJ_DATATYPE, (int)(sizeof(objs) / sizeof(objs[0])), objs, FALSE, &obj_count)) <= 0 + && obj_count != 0) { + /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) if(H5I_dec_ref(objs[u]) < 0) HGOTO_ERROR(H5E_ATOM, H5E_CLOSEERROR, FAIL, "can't close object") } /* end while */ + if(result < 0) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "H5F_get_obj_ids failed(2)") } /* end if */ } /* end if */ @@ -2551,6 +2570,139 @@ done: /*------------------------------------------------------------------------- + * Function: H5Fget_file_image + * + * Purpose: If a buffer is provided (via the buf_ptr argument) and is + * big enough (size in buf_len argument), load *buf_ptr with + * an image of the open file whose ID is provided in the + * file_id parameter, and return the number of bytes copied + * to the buffer. + * + * If the buffer exists, but is too small to contain an image + * of the indicated file, return a negative number. + * + * Finally, if no buffer is provided, return the size of the + * buffer needed. This value is simply the eoa of the target + * file. + * + * Note that any user block is skipped. + * + * Also note that the function may not be used on files + * opened with either the split/multi file driver or the + * family file driver. + * + * In the former case, the sparse address space makes the + * get file image operation impractical, due to the size of + * the image typically required. + * + * In the case of the family file driver, the problem is + * the driver message in the super block, which will prevent + * the image being opened with any driver other than the + * family file driver -- which negates the purpose of the + * operation. This can be fixed, but no resources for + * this now. + * + * Return: Success: Bytes copied / number of bytes needed. + * Failure: negative value + * + * Programmer: John Mainzer + * 11/15/11 + * + *------------------------------------------------------------------------- + */ +ssize_t +H5Fget_file_image(hid_t file_id, void *buf_ptr, size_t buf_len) +{ + H5F_t *file; /* File object for file ID */ + H5FD_t *fd_ptr; /* file driver */ + haddr_t eoa; /* End of file address */ + ssize_t ret_value; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "i*xz", file_id, buf_ptr, buf_len); + + /* Check args */ + if(NULL == (file = (H5F_t *)H5I_object_verify(file_id, H5I_FILE))) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") + if(!file || !file->shared || !file->shared->lf) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "file_id yields invalid file pointer") + fd_ptr = file->shared->lf; + if(!fd_ptr->cls) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "fd_ptr yields invalid class pointer") + + /* the address space used by the split and multi file drivers is not + * a good fit for this call. Since the plan is to depreciate these + * drivers anyway, don't bother to do a "force fit". + * + * The following clause tests for the multi file driver, and fails + * if the supplied file has the multi file driver as its top level + * file driver. However, this test will not work if there is some + * other file driver sitting on top of the multi file driver. + * + * I'm not sure if this is possible at present, but in all likelyhood, + * it will become possible in the future. On the other hand, we may + * remove the split/multi file drivers before then. + * + * I am leaving this solution in for now, but we should review it, + * and improve the solution if necessary. + * + * JRM -- 11/11/22 + */ + if(HDstrcmp(fd_ptr->cls->name, "multi") == 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Not supported for multi file driver.") + + /* While the family file driver is conceptually fully compatible + * with the get file image operation, it sets a file driver message + * in the super block that prevents the image being opened with any + * driver other than the family file driver. Needless to say, this + * rather defeats the purpose of the get file image operation. + * + * While this problem is quire solvable, the required time and + * resources are lacking at present. Hence, for now, we don't + * allow the get file image operation to be perfomed on files + * opened with the family file driver. + * + * Observe that the following test only looks at the top level + * driver, and fails if there is some other driver sitting on to + * of the family file driver. + * + * I don't think this can happen at present, but that may change + * in the future. + * JRM -- 12/21/11 + */ + if(HDstrcmp(fd_ptr->cls->name, "family") == 0) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "Not supported for family file driver.") + + + /* Go get the actual file size */ + if(HADDR_UNDEF == (eoa = H5FD_get_eoa(file->shared->lf, H5FD_MEM_DEFAULT))) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get file size") + + /* set ret_value = to eoa -- will overwrite this if appropriate */ + ret_value = (ssize_t)eoa; + + /* test to see if a buffer was provided -- if not, we are done */ + if(buf_ptr != NULL) { + size_t space_needed; /* size of file image */ + + /* Check for buffer too small */ + if((haddr_t)buf_len < eoa) + HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "supplied buffer too small") + + space_needed = (size_t)eoa; + + /* read in the file image */ + /* (Note compensation for base address addition in internal routine) */ + if(H5FD_read(fd_ptr, H5AC_ind_dxpl_id, H5FD_MEM_DEFAULT, 0, space_needed, buf_ptr) < 0) + HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "file image read request failed") + } /* end if */ + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_file_image() */ + + +/*------------------------------------------------------------------------- * Function: H5Fget_mdc_config * * Purpose: Retrieves the current automatic cache resize configuration diff --git a/src/H5FD.c b/src/H5FD.c index 66fa3b9..18b0eb6 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -70,6 +70,10 @@ static herr_t H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, static herr_t H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl); static herr_t H5FD_free_cls(H5FD_class_t *cls); +static herr_t H5FD_fapl_copy(hid_t driver_id, const void *fapl, void **copied_fapl); +static herr_t H5FD_dxpl_copy(hid_t driver_id, const void *dxpl, void **copied_dxpl); +static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/); +static int H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/); /*********************/ /* Package Variables */ @@ -750,17 +754,15 @@ done: * Programmer: Robb Matzke * Tuesday, August 3, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) { H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -871,17 +873,15 @@ done: * Programmer: Robb Matzke * Tuesday, August 3, 1999 * - * Modifications: - * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) { H5FD_class_t *driver; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ if(NULL == (driver = (H5FD_class_t *)H5I_object(driver_id))) @@ -1039,6 +1039,8 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_t *file = NULL; /* VFD file struct */ hid_t driver_id = -1; /* VFD ID */ H5P_genplist_t *plist; /* Property list pointer */ + unsigned long driver_flags = 0; /* File-inspecific driver feature flags */ + H5FD_file_image_info_t file_image_info; /* Initial file image */ H5FD_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(NULL) @@ -1061,6 +1063,19 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if(NULL == driver->open) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") + /* Query driver flag */ + H5FD_driver_query(driver, &driver_flags); + + /* Get initial file image info */ + if(H5P_get(plist, H5F_ACS_FILE_IMAGE_INFO_NAME, &file_image_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get file image info") + + /* If an image is provided, make sure the driver supports this feature */ + HDassert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || + ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); + if((file_image_info.buffer != NULL) && !(driver_flags & H5FD_FEAT_ALLOW_FILE_IMAGE)) + HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file image set, but not supported.") + /* Dispatch to file driver */ if(HADDR_UNDEF == maxaddr) maxaddr = driver->maxaddr; @@ -1318,19 +1333,17 @@ done: * Programmer: Quincey Koziol * Friday, August 25, 2000 * - * Modifications: - * *------------------------------------------------------------------------- */ -int +static int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) { - int ret_value=0; + int ret_value = 0; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT - assert(f); - assert(flags); + HDassert(f); + HDassert(flags); /* Check for query driver and call it */ if(f->cls->query) @@ -1340,7 +1353,44 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5FD_query() */ + + +/*------------------------------------------------------------------------- +* Function: H5FD_driver_query +* +* Purpose: Similar to H5FD_query(), but intended for cases when we don't +* have a file available (e.g. before one is opened). Since we +* can't use the file to get the driver, the driver is passed in +* as a parameter. +* +* Return: Success: non-negative +* Failure: negative +* +* Programmer: Jacob Gruber +* Wednesday, August 17, 2011 +* +*------------------------------------------------------------------------- +*/ +static int +H5FD_driver_query(const H5FD_class_t *driver, unsigned long *flags/*out*/) +{ + int ret_value = 0; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(driver); + HDassert(flags); + + /* Check for the driver to query and then query it */ + if(driver->query) + ret_value = (driver->query)(NULL, flags); + else + *flags = 0; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_driver_query() */ /*------------------------------------------------------------------------- diff --git a/src/H5FDcore.c b/src/H5FDcore.c index ff99cab..1fef36c 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -101,6 +101,7 @@ typedef struct H5FD_core_t { HANDLE hFile; /* Native windows file handle */ #endif /* H5_HAVE_WIN32_API */ hbool_t dirty; /*changes not saved? */ + H5FD_file_image_callbacks_t fi_callbacks; /* file image callbacks */ } H5FD_core_t; /* Driver-specific file access properties */ @@ -412,6 +413,7 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, #endif h5_stat_t sb; int fd=-1; + H5FD_file_image_info_t file_image_info; H5FD_t *ret_value; FUNC_ENTER_NOAPI_NOINIT @@ -434,10 +436,32 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, if(H5F_ACC_CREAT & flags) o_flags |= O_CREAT; if(H5F_ACC_EXCL & flags) o_flags |= O_EXCL; + /* Retrieve initial file image info */ + if(H5P_get(plist, H5F_ACS_FILE_IMAGE_INFO_NAME, &file_image_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get initial file image info") + + /* If the file image exists and this is an open, make sure the file doesn't exist */ + HDassert(((file_image_info.buffer != NULL) && (file_image_info.size > 0)) || + ((file_image_info.buffer == NULL) && (file_image_info.size == 0))); + if((file_image_info.buffer != NULL) && !(H5F_ACC_CREAT & flags)) { + if(HDopen(name, o_flags, 0666) >= 0) + HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file already exists") + + /* If backing store is requested, create and stat the file + * Note: We are forcing the O_CREAT flag here, even though this is + * technically an open. + */ + if(fa->backing_store) { + if((fd = HDopen(name, o_flags | O_CREAT, 0666)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to create file") + if(HDfstat(fd, &sb) < 0) + HSYS_GOTO_ERROR(H5E_FILE, H5E_BADFILE, NULL, "unable to fstat file") + } /* end if */ + } /* end if */ /* Open backing store, and get stat() from file. The only case that backing * store is off is when the backing_store flag is off and H5F_ACC_CREAT is * on. */ - if(fa->backing_store || !(H5F_ACC_CREAT & flags)) { + else if(fa->backing_store || !(H5F_ACC_CREAT & flags)) { if(fa && (fd = HDopen(name, o_flags, 0666)) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") if(HDfstat(fd, &sb) < 0) @@ -460,6 +484,9 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, /* If save data in backing store. */ file->backing_store = fa->backing_store; + /* Save file image callbacks */ + file->fi_callbacks = file_image_info.callbacks; + if(fd >= 0) { /* Retrieve information for determining uniqueness of file */ #ifdef H5_HAVE_WIN32_API @@ -491,51 +518,70 @@ H5FD_core_open(const char *name, unsigned flags, hid_t fapl_id, size_t size; /* Retrieve file size */ - size = (size_t)sb.st_size; + if(file_image_info.buffer && file_image_info.size > 0) + size = file_image_info.size; + else + size = (size_t)sb.st_size; /* Check if we should allocate the memory buffer and read in existing data */ if(size) { - /* Allocate memory for the file's data */ - if(NULL == (file->mem = (unsigned char*)H5MM_malloc(size))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory block") + /* Allocate memory for the file's data, using the file image callback if available. */ + if(file->fi_callbacks.image_malloc) { + if(NULL == (file->mem = (unsigned char*)file->fi_callbacks.image_malloc(size, H5FD_FILE_IMAGE_OP_FILE_OPEN, file->fi_callbacks.udata))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "image malloc callback failed") + } /* end if */ + else { + if(NULL == (file->mem = (unsigned char*)H5MM_malloc(size))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "unable to allocate memory block") + } /* end else */ /* Set up data structures */ file->eof = size; - /* Read in existing data, being careful of interrupted system calls, - * partial results, and the end of the file. - */ - while(size > 0) { - - h5_core_io_t bytes_in = 0; /* # of bytes to read */ - h5_core_io_ret_t bytes_read = -1; /* # of bytes actually read */ - - /* Trying to read more bytes than the return type can handle is - * undefined behavior in POSIX. - */ - if(size > H5_CORE_MAX_IO_BYTES_g) - bytes_in = H5_CORE_MAX_IO_BYTES_g; - else - bytes_in = (h5_core_io_t)size; - - do { - bytes_read = HDread(file->fd, file->mem, bytes_in); - } while(-1 == bytes_read && EINTR == errno); - - if(-1 == bytes_read) { /* error */ - int myerrno = errno; - time_t mytime = HDtime(NULL); - HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); - - HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, size = %lu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long)size, (unsigned long long)myoffset); + /* If there is an initial file image, copy it, using the callback if possible */ + if(file_image_info.buffer && file_image_info.size > 0) { + if(file->fi_callbacks.image_memcpy) { + if(file->mem != file->fi_callbacks.image_memcpy(file->mem, file_image_info.buffer, size, H5FD_FILE_IMAGE_OP_FILE_OPEN, file->fi_callbacks.udata)) + HGOTO_ERROR(H5E_FILE, H5E_CANTCOPY, NULL, "image_memcpy callback failed") } /* end if */ - - HDassert(bytes_read >= 0); - HDassert((size_t)bytes_read <= size); - - size -= (size_t)bytes_read; - - } /* end while */ + else + HDmemcpy(file->mem, file_image_info.buffer, size); + } /* end if */ + /* Read in existing data from the file if there is no image */ + else { + /* Read in existing data, being careful of interrupted system calls, + * partial results, and the end of the file. + */ + while(size > 0) { + h5_core_io_t bytes_in = 0; /* # of bytes to read */ + h5_core_io_ret_t bytes_read = -1; /* # of bytes actually read */ + + /* Trying to read more bytes than the return type can handle is + * undefined behavior in POSIX. + */ + if(size > H5_CORE_MAX_IO_BYTES_g) + bytes_in = H5_CORE_MAX_IO_BYTES_g; + else + bytes_in = (h5_core_io_t)size; + + do { + bytes_read = HDread(file->fd, file->mem, bytes_in); + } while(-1 == bytes_read && EINTR == errno); + + if(-1 == bytes_read) { /* error */ + int myerrno = errno; + time_t mytime = HDtime(NULL); + HDoff_t myoffset = HDlseek(file->fd, (HDoff_t)0, SEEK_CUR); + + HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "file read failed: time = %s, filename = '%s', file descriptor = %d, errno = %d, error message = '%s', file->mem = %p, size = %lu, offset = %llu", HDctime(&mytime), file->name, file->fd, myerrno, HDstrerror(myerrno), file->mem, (unsigned long)size, (unsigned long long)myoffset); + } /* end if */ + + HDassert(bytes_read >= 0); + HDassert((size_t)bytes_read <= size); + + size -= (size_t)bytes_read; + } /* end while */ + } /* end else */ } /* end if */ } /* end if */ @@ -578,8 +624,15 @@ H5FD_core_close(H5FD_t *_file) HDclose(file->fd); if(file->name) H5MM_xfree(file->name); - if(file->mem) - H5MM_xfree(file->mem); + if(file->mem) { + /* Use image callback if available */ + if(file->fi_callbacks.image_free) { + if(file->fi_callbacks.image_free(file->mem, H5FD_FILE_IMAGE_OP_FILE_CLOSE, file->fi_callbacks.udata) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTFREE, FAIL, "image_free callback failed") + } /* end if */ + else + H5MM_xfree(file->mem); + } /* end if */ HDmemset(file, 0, sizeof(H5FD_core_t)); H5MM_xfree(file); @@ -700,9 +753,11 @@ H5FD_core_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ + *flags |= H5FD_FEAT_ALLOW_FILE_IMAGE; /* OK to use file image feature with this VFD */ + *flags |= H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS; /* OK to use file image callbacks with this VFD */ /* If the backing store is open, a POSIX file handle is available */ - if(file->fd >= 0 && file->backing_store) + if(file && file->fd >= 0 && file->backing_store) *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ } /* end if */ @@ -976,9 +1031,16 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had if((addr + size) % file->increment) new_eof += file->increment; - /* (Re)allocate memory for the file buffer */ - if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof) + /* (Re)allocate memory for the file buffer, using callbacks if available */ + if(file->fi_callbacks.image_realloc) { + if(NULL == (x = (unsigned char *)file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, file->fi_callbacks.udata))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes with callback", (unsigned long long)new_eof) + } /* end if */ + else { + if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof) + } /* end else */ + #ifdef H5_CLEAR_MEMORY HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof)); #endif /* H5_CLEAR_MEMORY */ @@ -989,6 +1051,8 @@ HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof)); /* Write from BUF to memory */ HDmemcpy(file->mem + addr, buf, size); + + /* Mark memory buffer as modified */ file->dirty = TRUE; done: @@ -1075,6 +1139,28 @@ done: * Purpose: Makes sure that the true file size is the same (or larger) * than the end-of-address. * + * Addendum -- 12/2/11 + * For file images opened with the core file driver, it is + * necessary that we avoid reallocating the core file driver's + * buffer uneccessarily. + * + * To this end, I have made the following functional changes + * to this function. + * + * If we are closing, and there is no backing store, this + * function becomes a no-op. + * + * If we are closing, and there is backing store, we set the + * eof to equal the eoa, and truncate the backing store to + * the new eof + * + * If we are not closing, we realloc the buffer to size equal + * to the smallest multiple of the allocation increment that + * equals or exceeds the eoa and set the eof accordingly. + * Note that we no longer truncate the backing store to the + * new eof if applicable. + * -- JRM + * * Return: Success: Non-negative * Failure: Negative * @@ -1085,7 +1171,7 @@ done: */ /* ARGSUSED */ static herr_t -H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) +H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t closing) { H5FD_core_t *file = (H5FD_core_t*)_file; size_t new_eof; /* New size of memory buffer */ @@ -1095,68 +1181,83 @@ H5FD_core_truncate(H5FD_t *_file, hid_t UNUSED dxpl_id, hbool_t UNUSED closing) HDassert(file); - /* Determine new size of memory buffer */ - H5_ASSIGN_OVERFLOW(new_eof, file->increment * (file->eoa / file->increment), hsize_t, size_t); - if(file->eoa % file->increment) - new_eof += file->increment; - - /* Extend the file to make sure it's large enough */ - if(!H5F_addr_eq(file->eof, (haddr_t)new_eof)) { - unsigned char *x; /* Pointer to new buffer for file data */ + /* if we are closing and not using backing store, do nothing */ + if(!closing || file->backing_store) { + if(closing) /* set eof to eoa */ + new_eof = file->eoa; + else { /* set eof to smallest multiple of increment that exceeds eoa */ + /* Determine new size of memory buffer */ + H5_ASSIGN_OVERFLOW(new_eof, file->increment * (file->eoa / file->increment), hsize_t, size_t); + if(file->eoa % file->increment) + new_eof += file->increment; + } /* end else */ + + /* Extend the file to make sure it's large enough */ + if(!H5F_addr_eq(file->eof, (haddr_t)new_eof)) { + unsigned char *x; /* Pointer to new buffer for file data */ + + /* (Re)allocate memory for the file buffer, using callback if available */ + if(file->fi_callbacks.image_realloc) { + if(NULL == (x = (unsigned char *)file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, file->fi_callbacks.udata))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block with callback") + } /* end if */ + else { + if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof))) + HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block") + } /* end else */ - /* (Re)allocate memory for the file buffer */ - if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof))) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") #ifdef H5_CLEAR_MEMORY -if(file->eof < new_eof) - HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof)); + if(file->eof < new_eof) + HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof)); #endif /* H5_CLEAR_MEMORY */ - file->mem = x; + file->mem = x; - /* Update backing store, if using it */ - if(file->fd >= 0 && file->backing_store) { + /* Update backing store, if using it and if closing */ + if(closing && (file->fd >= 0) && file->backing_store) { #ifdef H5_HAVE_WIN32_API - LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ - DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() - * Only used as an error code here. - */ - DWORD dwError; /* DWORD error code from GetLastError() */ - BOOL bError; /* Boolean error flag */ - - /* Windows uses this odd QuadPart union for 32/64-bit portability */ - li.QuadPart = (__int64)file->eoa; - - /* Extend the file to make sure it's large enough. - * - * Since INVALID_SET_FILE_POINTER can technically be a valid return value - * from SetFilePointer(), we also need to check GetLastError(). - */ - dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); - if(INVALID_SET_FILE_POINTER == dwPtrLow) { - dwError = GetLastError(); - if(dwError != NO_ERROR ) - HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") - } - - bError = SetEndOfFile(file->hFile); - if(0 == bError) - HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + LARGE_INTEGER li; /* 64-bit (union) integer for SetFilePointer() call */ + DWORD dwPtrLow; /* Low-order pointer bits from SetFilePointer() + * Only used as an error code here. + */ + DWORD dwError; /* DWORD error code from GetLastError() */ + BOOL bError; /* Boolean error flag */ + + /* Windows uses this odd QuadPart union for 32/64-bit portability */ + li.QuadPart = (__int64)file->eoa; + + /* Extend the file to make sure it's large enough. + * + * Since INVALID_SET_FILE_POINTER can technically be a valid return value + * from SetFilePointer(), we also need to check GetLastError(). + */ + dwPtrLow = SetFilePointer(file->hFile, li.LowPart, &li.HighPart, FILE_BEGIN); + if(INVALID_SET_FILE_POINTER == dwPtrLow) { + dwError = GetLastError(); + if(dwError != NO_ERROR ) + HGOTO_ERROR(H5E_FILE, H5E_FILEOPEN, FAIL, "unable to set file pointer") + } + + bError = SetEndOfFile(file->hFile); + if(0 == bError) + HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #else /* H5_HAVE_WIN32_API */ #ifdef H5_VMS - /* Reset seek offset to the beginning of the file, so that the file isn't - * re-extended later. This may happen on Open VMS. */ - if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") + /* Reset seek offset to the beginning of the file, so that the file isn't + * re-extended later. This may happen on Open VMS. */ + if(-1 == HDlseek(file->fd, (HDoff_t)0, SEEK_SET)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position") #endif /* H5_VMS */ - if(-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) - HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") + if(-1 == HDftruncate(file->fd, (HDoff_t)new_eof)) + HSYS_GOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to extend file properly") #endif /* H5_HAVE_WIN32_API */ - } /* end if */ + } /* end if */ - /* Update the eof value */ - file->eof = new_eof; - } /* end if */ + /* Update the eof value */ + file->eof = new_eof; + } /* end if */ + } /* end if(file->eof < file->eoa) */ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_core_truncate() */ + diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 17683ce..6f6d757 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -995,7 +995,7 @@ H5FD_family_query(const H5FD_t * _file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */ /* Check for flags that are set by h5repart */ - if(file->repart_members) + if(file && file->repart_members) *flags |= H5FD_FEAT_DIRTY_SBLK_LOAD; /* Mark the superblock dirty when it is loaded (so the family member sizes are rewritten) */ } /* end if */ diff --git a/src/H5FDlog.c b/src/H5FDlog.c index cb5ce3c..0b5c677 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -918,7 +918,7 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ /* Check for flags that are set by h5repart */ - if(file->fam_to_sec2) + if(file && file->fam_to_sec2) *flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */ } /* end if */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 4f7d059..9c19562 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -52,6 +52,29 @@ typedef enum { } H5FD_file_op_t; +/* Define structure to hold initial file image and other relevant information */ +typedef struct { + void *buffer; + size_t size; + H5FD_file_image_callbacks_t callbacks; +} H5FD_file_image_info_t; + +/* Define default file image info */ +#define H5FD_DEFAULT_FILE_IMAGE_INFO { \ + /* file image buffer */ NULL, \ + /* buffer size */ 0, \ + { /* Callbacks */ \ + /* image_malloc */ NULL, \ + /* image_memcpy */ NULL, \ + /* image_realloc */ NULL, \ + /* image_free */ NULL, \ + /* udata_copy */ NULL, \ + /* udata_free */ NULL, \ + /* udata */ NULL, \ + } \ +} + + /*****************************/ /* Library Private Variables */ /*****************************/ @@ -72,17 +95,14 @@ H5_DLL herr_t H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf); H5_DLL herr_t H5FD_sb_decode(H5FD_t *file, const char *name, const uint8_t *buf); H5_DLL void *H5FD_fapl_get(H5FD_t *file); H5_DLL herr_t H5FD_fapl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info); -H5_DLL herr_t H5FD_fapl_copy(hid_t driver_id, const void *fapl, void **copied_fapl); H5_DLL herr_t H5FD_fapl_close(hid_t driver_id, void *fapl); H5_DLL herr_t H5FD_dxpl_open(struct H5P_genplist_t *plist, hid_t driver_id, const void *driver_info); -H5_DLL herr_t H5FD_dxpl_copy(hid_t driver_id, const void *dxpl, void **copied_dxpl); H5_DLL herr_t H5FD_dxpl_close(hid_t driver_id, void *dxpl); H5_DLL hid_t H5FD_register(const void *cls, size_t size, hbool_t app_ref); H5_DLL H5FD_t *H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); H5_DLL herr_t H5FD_close(H5FD_t *file); H5_DLL int H5FD_cmp(const H5FD_t *f1, const H5FD_t *f2); -H5_DLL int H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/); H5_DLL haddr_t H5FD_alloc(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, hsize_t size, haddr_t *align_addr, hsize_t *align_size); H5_DLL herr_t H5FD_free(H5FD_t *file, hid_t dxpl_id, H5FD_mem_t type, struct H5F_t *f, diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index f495e2d..ab19c68 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -222,6 +222,19 @@ typedef enum H5F_mem_t H5FD_mem_t; * instead of the default H5D_ALLOC_TIME_LATE */ #define H5FD_FEAT_ALLOCATE_EARLY 0x00000200 + /* + * Defining the H5FD_FEAT_ALLOW_FILE_IMAGE for a VFL driver means that + * the driver is able to use a file image in the fapl as the initial + * contents of a file. + */ +#define H5FD_FEAT_ALLOW_FILE_IMAGE 0x00000400 + /* + * Defining the H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS for a VFL driver + * means that the driver is able to use callbacks to make a copy of the + * image to store in memory. + */ +#define H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS 0x00000800 + /* Forward declaration */ typedef struct H5FD_t H5FD_t; @@ -291,6 +304,33 @@ struct H5FD_t { hsize_t alignment; /* Allocation alignment */ }; +/* Define enum for the source of file image callbacks */ +typedef enum { + H5FD_FILE_IMAGE_OP_NO_OP, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, + H5FD_FILE_IMAGE_OP_FILE_OPEN, + H5FD_FILE_IMAGE_OP_FILE_RESIZE, + H5FD_FILE_IMAGE_OP_FILE_CLOSE, +} H5FD_file_image_op_t; + +/* Define structure to hold file image callbacks */ +typedef struct { + void *(*image_malloc)(size_t size, H5FD_file_image_op_t file_image_op, + void *udata); + void *(*image_memcpy)(void *dest, const void *src, size_t size, + H5FD_file_image_op_t file_image_op, void *udata); + void *(*image_realloc)(void *ptr, size_t size, + H5FD_file_image_op_t file_image_op, void *udata); + herr_t (*image_free)(void *ptr, H5FD_file_image_op_t file_image_op, + void *udata); + void *(*udata_copy)(void *udata); + herr_t (*udata_free)(void *udata); + void *udata; +} H5FD_file_image_callbacks_t; + #ifdef __cplusplus extern "C" { #endif diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 6d4a76a..4201e07 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -560,7 +560,7 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */) *flags |= H5FD_FEAT_POSIX_COMPAT_HANDLE; /* VFD handle is POSIX I/O call compatible */ /* Check for flags that are set by h5repart */ - if(file->fam_to_sec2) + if(file && file->fam_to_sec2) *flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */ } /* end if */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 868674f..40e075b 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -417,6 +417,7 @@ typedef struct H5F_blk_aggr_t H5F_blk_aggr_t; #define H5F_ACS_LATEST_FORMAT_NAME "latest_format" /* 'Use latest format version' flag */ #define H5F_ACS_WANT_POSIX_FD_NAME "want_posix_fd" /* Internal: query the file descriptor from the core VFD, instead of the memory address */ #define H5F_ACS_EFC_SIZE_NAME "efc_size" /* Size of external file cache */ +#define H5F_ACS_FILE_IMAGE_INFO_NAME "file_image_info" /* struct containing initial file image and callback info */ /* ======================== File Mount properties ====================*/ #define H5F_MNT_SYM_LOCAL_NAME "local" /* Whether absolute symlinks local to file. */ @@ -528,8 +529,8 @@ H5_DLL H5F_t *H5F_get_parent(const H5F_t *f); H5_DLL unsigned H5F_get_nmounts(const H5F_t *f); H5_DLL hid_t H5F_get_access_plist(H5F_t *f, hbool_t app_ref); H5_DLL hid_t H5F_get_id(H5F_t *file, hbool_t app_ref); -H5_DLL size_t H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref); -H5_DLL size_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *obj_id_list, hbool_t app_ref); +H5_DLL herr_t H5F_get_obj_count(const H5F_t *f, unsigned types, hbool_t app_ref, size_t *obj_id_count_ptr); +H5_DLL herr_t H5F_get_obj_ids(const H5F_t *f, unsigned types, size_t max_objs, hid_t *oid_list, hbool_t app_ref, size_t *obj_id_count_ptr); /* Functions than retrieve values set/cached from the superblock/FCPL */ H5_DLL haddr_t H5F_get_base_addr(const H5F_t *f); diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index d88538b..f32b3e0 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -192,6 +192,7 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); +H5_DLL ssize_t H5Fget_file_image(hid_t file_id, void * buf_ptr, size_t buf_len); H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, diff --git a/src/H5Gname.c b/src/H5Gname.c index 62875dc..576d866 100644 --- a/src/H5Gname.c +++ b/src/H5Gname.c @@ -782,7 +782,7 @@ done: /*------------------------------------------------------------------------- * Function: H5G_name_replace_cb * - * Purpose: H5I_search callback function to replace group entry names + * Purpose: H5I_iterate callback function to replace group entry names * * Return: Success: 0, Failure: -1 * @@ -1166,15 +1166,18 @@ H5G_name_replace(const H5O_link_t *lnk, H5G_names_op_t op, H5F_t *src_file, /* Search through group IDs */ if(search_group) - H5I_search(H5I_GROUP, H5G_name_replace_cb, &names, FALSE); + if(H5I_iterate(H5I_GROUP, H5G_name_replace_cb, &names, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over groups") /* Search through dataset IDs */ if(search_dataset) - H5I_search(H5I_DATASET, H5G_name_replace_cb, &names, FALSE); + if(H5I_iterate(H5I_DATASET, H5G_name_replace_cb, &names, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datasets") /* Search through datatype IDs */ if(search_datatype) - H5I_search(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE); + if(H5I_iterate(H5I_DATATYPE, H5G_name_replace_cb, &names, FALSE) < 0) + HGOTO_ERROR(H5E_SYM, H5E_BADITER, FAIL, "can't iterate over datatypes") } /* end if */ } /* end if */ diff --git a/src/H5I.c b/src/H5I.c index 09d5dde..0382e8e 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -108,6 +108,11 @@ typedef struct { H5I_id_info_t **id_list; /*pointer to an array of ptrs to IDs */ } H5I_id_type_t; +typedef struct { + H5I_search_func_t app_cb; /* Application's callback routine */ + void *app_key; /* Application's "key" (user data) */ + void *ret_obj; /* Object to return */ +} H5I_search_ud_t; /*-------------------- Locally scoped variables -----------------------------*/ @@ -127,6 +132,7 @@ H5FL_DEFINE_STATIC(H5I_id_info_t); /*--------------------- Local function prototypes ---------------------------*/ static H5I_id_info_t *H5I_find_id(hid_t id); +static int H5I_search_cb(void *obj, hid_t id, void *udata); #ifdef H5I_DEBUG_OUTPUT static herr_t H5I_debug(H5I_type_t type); #endif /* H5I_DEBUG_OUTPUT */ @@ -1905,6 +1911,40 @@ done: /*------------------------------------------------------------------------- + * Function: H5I_search_cb + * + * Purpose: Callback routine for H5Isearch, when it calls H5I_iterate. + * Calls "user" callback search function, and then sets return + * value, based on the result of that callback. + * + * Return: Success: The first object in the type for which FUNC + * returns non-zero. NULL if FUNC returned zero + * for every object in the type. + * Failure: NULL + * + * Programmer: Quincey Koziol + * Friday, March 30, 2012 + * + *------------------------------------------------------------------------- + */ +static int +H5I_search_cb(void *obj, hid_t id, void *_udata) +{ + H5I_search_ud_t *udata = (H5I_search_ud_t *)_udata; /* User data for callback */ + int ret_value; /* Callback return value */ + + FUNC_ENTER_NOAPI_NOINIT + + ret_value = (*udata->app_cb)(obj, id, udata->app_key); + if(ret_value > 0) + udata->ret_obj = obj; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5I_search_cb() */ + + +/*------------------------------------------------------------------------- * Function: H5Isearch * * Purpose: Apply function FUNC to each member of type TYPE and return a @@ -1931,14 +1971,27 @@ done: void * H5Isearch(H5I_type_t type, H5I_search_func_t func, void *key) { - void * ret_value; /* Return value */ + H5I_search_ud_t udata; /* Context for iteration */ + void *ret_value; /* Return value */ FUNC_ENTER_API(NULL) + /* Check arguments */ if(H5I_IS_LIB_TYPE(type)) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "cannot call public function on library type") - ret_value = H5I_search(type, func, key, TRUE); + /* Set up udata struct */ + udata.app_cb = func; + udata.app_key = key; + udata.ret_obj = NULL; + + /* Note that H5I_iterate returns an error code. We ignore it + * here, as we can't do anything with it without revising the API. + */ + H5I_iterate(type, H5I_search_cb, &udata, TRUE); + + /* Set return value */ + ret_value = udata.ret_obj; done: FUNC_LEAVE_API(ret_value) @@ -1946,62 +1999,71 @@ done: /*------------------------------------------------------------------------- - * Function: H5I_search + * Function: H5I_iterate * - * Purpose: Apply function FUNC to each member of type TYPE and return a - * pointer to the first object for which FUNC returns non-zero. - * The FUNC should take a pointer to the object and the KEY as - * arguments and return non-zero to terminate the search (zero - * to continue). + * Purpose: Apply function FUNC to each member of type TYPE (with + * non-zero application reference count if app_ref is TRUE). + * Stop if FUNC returns a non zero value (i.e. anything + * other than H5_ITER_CONT). * - * Limitation: Currently there is no way to start searching from where a - * previous search left off. + * If FUNC returns a positive value (i.e. H5_ITER_STOP), + * return SUCCEED. * - * Return: Success: The first object in the type for which FUNC - * returns non-zero. NULL if FUNC returned zero - * for every object in the type. - * Failure: NULL + * If FUNC returns a negative value (i.e. H5_ITER_ERROR), + * return FAIL. + * + * The FUNC should take a pointer to the object and the + * udata as arguments and return non-zero to terminate + * siteration, and zero to continue. * - * Programmer: Robb Matzke - * Friday, February 19, 1999 + * Limitation: Currently there is no way to start the iteration from + * where a previous iteration left off. + * + * Return: Success: SUCCEED + * Failure: FAIL * - * Modifications: Neil Fortner - * Wednesday, October 1, 2008 - * Added app_ref parameter. When set to TRUE, the function will only - * operate on ids that have a nonzero application reference count. + * Programmer: John Mainzer + * Monday, December 6, 2011 * *------------------------------------------------------------------------- */ -void * -H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref) +herr_t +H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref) { - H5I_id_type_t *type_ptr; /*ptr to the type */ - void *ret_value = NULL; /*return value */ + H5I_id_type_t *type_ptr; /*ptr to the type */ + herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_NOAPI(FAIL) /* Check arguments */ if(type <= H5I_BADID || type >= H5I_next_type) - HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "invalid type number") + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number") type_ptr = H5I_id_type_list_g[type]; - if(type_ptr == NULL || type_ptr->count <= 0) - HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, NULL, "invalid type") - /* Only iterate through hash table if there are IDs in group */ - if(type_ptr->ids > 0) { - H5I_id_info_t *id_ptr; /*ptr to the new ID */ - H5I_id_info_t *next_id; /*ptr to the next ID */ - unsigned i; /*counter */ + /* Only iterate through hash table if it is initialized and there are IDs in group */ + if(type_ptr && type_ptr->count > 0 && type_ptr->ids > 0) { + unsigned u; /* Counter */ /* Start at the beginning of the array */ - for(i = 0; i < type_ptr->hash_size; i++) { - id_ptr = type_ptr->id_list[i]; + for(u = 0; u < type_ptr->hash_size; u++) { + H5I_id_info_t *id_ptr; /* Ptr to the new ID */ + + id_ptr = type_ptr->id_list[u]; while(id_ptr) { - next_id = id_ptr->next; /* Protect against ID being deleted in callback */ - /* (Casting away const OK -QAK) */ - if((!app_ref || id_ptr->app_count) && (*func)((void *)id_ptr->obj_ptr, id_ptr->id, key)) - /* (Casting away const OK -QAK) */ - HGOTO_DONE((void *)id_ptr->obj_ptr); /*found the item*/ + H5I_id_info_t *next_id; /* Ptr to the next ID */ + + /* Protect against ID being deleted in callback */ + next_id = id_ptr->next; + if((!app_ref) || (id_ptr->app_count > 0)) { + herr_t cb_ret_val; /* Callback return value */ + + /* (Casting away const OK) */ + cb_ret_val = (*func)((void *)id_ptr->obj_ptr, id_ptr->id, udata); + if(cb_ret_val > 0) + HGOTO_DONE(SUCCEED) /* terminate iteration early */ + else if(cb_ret_val < 0) + HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "func failed") + } /* end if */ id_ptr = next_id; } /* end while */ } /* end for */ @@ -2009,7 +2071,7 @@ H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5I_search() */ +} /* end H5I_iterate() */ /*------------------------------------------------------------------------- diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h index 98423df..bc0ef41 100644 --- a/src/H5Iprivate.h +++ b/src/H5Iprivate.h @@ -62,7 +62,7 @@ H5_DLL H5I_type_t H5I_get_type(hid_t id); H5_DLL hid_t H5I_get_file_id(hid_t obj_id, hbool_t app_ref); H5_DLL void *H5I_remove(hid_t id); H5_DLL void *H5I_remove_verify(hid_t id, H5I_type_t id_type); -H5_DLL void *H5I_search(H5I_type_t type, H5I_search_func_t func, void *key, hbool_t app_ref); +H5_DLL herr_t H5I_iterate(H5I_type_t type, H5I_search_func_t func, void *udata, hbool_t app_ref); H5_DLL int H5I_get_ref(hid_t id, hbool_t app_ref); H5_DLL int H5I_inc_ref(hid_t id, hbool_t app_ref); H5_DLL int H5I_dec_ref(hid_t id); diff --git a/src/H5Oattribute.c b/src/H5Oattribute.c index 055fb69..30ec732 100644 --- a/src/H5Oattribute.c +++ b/src/H5Oattribute.c @@ -703,18 +703,23 @@ H5O_attr_find_opened_attr(const H5O_loc_t *loc, H5A_t **attr, const char* name_t HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "can't get file serial number") /* Count all opened attributes */ - num_open_attr = H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE); + if(H5F_get_obj_count(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, FALSE, &num_open_attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't count opened attributes") /* Find out whether the attribute has been opened */ if(num_open_attr) { + size_t check_num_attr; /* Number of open attribute IDs */ size_t u; /* Local index variable */ /* Allocate space for the attribute ID list */ if(NULL == (attr_id_list = (hid_t *)H5MM_malloc(num_open_attr * sizeof(hid_t)))) - HGOTO_ERROR(H5E_ATTR, H5E_NOSPACE, FAIL, "unable to allocate memory for attribute ID list") + HGOTO_ERROR(H5E_ATTR, H5E_CANTALLOC, FAIL, "unable to allocate memory for attribute ID list") /* Retrieve the IDs of all opened attributes */ - H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE); + if(H5F_get_obj_ids(loc->file, H5F_OBJ_ATTR | H5F_OBJ_LOCAL, num_open_attr, attr_id_list, FALSE, &check_num_attr) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "can't get IDs of opened attributes") + if(check_num_attr != num_open_attr) + HGOTO_ERROR(H5E_INTERNAL, H5E_BADITER, FAIL, "open attribute count mismatch") /* Iterate over the attributes */ for(u = 0; u < num_open_attr; u++) { diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index c3371c9..7f72c85 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -40,6 +40,7 @@ #include "H5Fprivate.h" /* Files */ #include "H5FDprivate.h" /* File drivers */ #include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory Management */ #include "H5Ppkg.h" /* Property lists */ /* Includes needed to set as default file driver */ @@ -122,6 +123,12 @@ /* Definition for external file cache size */ #define H5F_ACS_EFC_SIZE_SIZE sizeof(unsigned) #define H5F_ACS_EFC_SIZE_DEF 0 +/* Definition of pointer to initial file image info */ +#define H5F_ACS_FILE_IMAGE_INFO_SIZE sizeof(H5FD_file_image_info_t) +#define H5F_ACS_FILE_IMAGE_INFO_DEF H5FD_DEFAULT_FILE_IMAGE_INFO +#define H5F_ACS_FILE_IMAGE_INFO_DEL H5P_file_image_info_del +#define H5F_ACS_FILE_IMAGE_INFO_COPY H5P_file_image_info_copy +#define H5F_ACS_FILE_IMAGE_INFO_CLOSE H5P_file_image_info_close /******************/ @@ -149,6 +156,10 @@ static herr_t H5P_facc_reg_prop(H5P_genclass_t *pclass); static herr_t H5P_facc_create(hid_t fapl_id, void *copy_data); static herr_t H5P_facc_copy(hid_t new_plist_t, hid_t old_plist_t, void *copy_data); +/* File image info property callbacks */ +static herr_t H5P_file_image_info_del(hid_t prop_id, const char *name, size_t size, void *value); +static herr_t H5P_file_image_info_copy(const char *name, size_t size, void *value); +static herr_t H5P_file_image_info_close(const char *name, size_t size, void *value); /*********************/ /* Package Variables */ @@ -215,6 +226,7 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) hbool_t latest_format = H5F_ACS_LATEST_FORMAT_DEF; /* Default setting for "use the latest version of the format" flag */ hbool_t want_posix_fd = H5F_ACS_WANT_POSIX_FD_DEF; /* Default setting for retrieving 'handle' from core VFD */ unsigned efc_size = H5F_ACS_EFC_SIZE_DEF; /* Default external file cache size */ + H5FD_file_image_info_t file_image_info = H5F_ACS_FILE_IMAGE_INFO_DEF; /* Default file image info and callbacks */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -300,6 +312,10 @@ H5P_facc_reg_prop(H5P_genclass_t *pclass) if(H5P_register_real(pclass, H5F_ACS_EFC_SIZE_NAME, H5F_ACS_EFC_SIZE_SIZE, &efc_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + /* Register the initial file image info */ + if(H5P_register_real(pclass, H5F_ACS_FILE_IMAGE_INFO_NAME, H5F_ACS_FILE_IMAGE_INFO_SIZE, &file_image_info, NULL, NULL, NULL, H5F_ACS_FILE_IMAGE_INFO_DEL, H5F_ACS_FILE_IMAGE_INFO_COPY, NULL, H5F_ACS_FILE_IMAGE_INFO_CLOSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5P_facc_reg_prop() */ @@ -2101,3 +2117,484 @@ done: FUNC_LEAVE_API(ret_value) } /* end H5Pget_elink_file_cache_size() */ + +/*------------------------------------------------------------------------- + * Function: H5Pset_file_image + * + * Purpose: Sets the initial file image. Some file drivers can initialize + * the starting data in a file from a buffer. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len) +{ + H5P_genplist_t *fapl; /* Property list pointer */ + H5FD_file_image_info_t image_info; /* File image info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*xz", fapl_id, buf_ptr, buf_len); + + /* validate parameters */ + if(!(((buf_ptr == NULL) && (buf_len == 0)) || ((buf_ptr != NULL) && (buf_len > 0)))) + HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "inconsistant buf_ptr and buf_len"); + + /* Get the plist structure */ + if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get old image info */ + if(H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image pointer") + + /* Release previous buffer, if it exists */ + if(image_info.buffer != NULL) { + if(image_info.callbacks.image_free) { + if(SUCCEED != image_info.callbacks.image_free(image_info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata)) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed") + } /* end if */ + else + H5MM_xfree(image_info.buffer); + } /* end if */ + + /* Update struct */ + if(buf_ptr) { + /* Allocate memory */ + if(image_info.callbacks.image_malloc) { + if(NULL == (image_info.buffer = image_info.callbacks.image_malloc(buf_len, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, image_info.callbacks.udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "image malloc callback failed") + } /* end if */ + else + if(NULL == (image_info.buffer = H5MM_malloc(buf_len))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") + + /* Copy data */ + if(image_info.callbacks.image_memcpy) { + if(image_info.buffer != image_info.callbacks.image_memcpy(image_info.buffer, + buf_ptr, buf_len, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, + image_info.callbacks.udata)) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + } /* end if */ + else + HDmemcpy(image_info.buffer, buf_ptr, buf_len); + } /* end if */ + else + image_info.buffer = NULL; + + image_info.size = buf_len; + + /* Set values */ + if(H5P_set(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file image info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_file_image() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_file_image + * + * Purpose: If the file image exists and buf_ptr_ptr is not NULL, + * allocate a buffer of the correct size, copy the image into + * the new buffer, and return the buffer to the caller in + * *buf_ptr_ptr. Do this using the file image callbacks + * if defined. + * + * NB: It is the responsibility of the caller to free the + * buffer whose address is returned in *buf_ptr_ptr. Do + * this using free if the file image callbacks are not + * defined, or with whatever method is appropriate if + * the callbacks are defined. + * + * If buf_ptr_ptr is not NULL, and no image exists, set + * *buf_ptr_ptr to NULL. + * + * If buf_len_ptr is not NULL, set *buf_len_ptr equal + * to the length of the file image if it exists, and + * to 0 if it does not. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr) +{ + H5P_genplist_t *fapl; /* Property list pointer */ + H5FD_file_image_info_t image_info; /* File image info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i**x*z", fapl_id, buf_ptr_ptr, buf_len_ptr); + + /* Get the plist structure */ + if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get values */ + if(H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &image_info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") + + /* verify file image field consistancy */ + HDassert(((image_info.buffer != NULL) && (image_info.size > 0)) || + ((image_info.buffer == NULL) && (image_info.size == 0))); + + /* Set output size */ + if(buf_len_ptr != NULL) + *buf_len_ptr = image_info.size; + + /* Duplicate the image if desired, using callbacks if available */ + if(buf_ptr_ptr != NULL) { + void * copy_ptr = NULL; /* Copy of memory image */ + + if(image_info.buffer != NULL) { + /* Allocate memory */ + if(image_info.callbacks.image_malloc) { + if(NULL == (copy_ptr = image_info.callbacks.image_malloc(image_info.size, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, image_info.callbacks.udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "image malloc callback failed") + } /* end if */ + else + if(NULL == (copy_ptr = H5MM_malloc(image_info.size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate copy") + + /* Copy data */ + if(image_info.callbacks.image_memcpy) { + if(copy_ptr != image_info.callbacks.image_memcpy(copy_ptr, image_info.buffer, + image_info.size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, + image_info.callbacks.udata)) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + } /* end if */ + else + HDmemcpy(copy_ptr, image_info.buffer, image_info.size); + } /* end if */ + + *buf_ptr_ptr = copy_ptr; + } /* end if */ + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_file_image */ + + +/*------------------------------------------------------------------------- + * Function: H5Pset_file_image_callbacks + * + * Purpose: Sets the callbacks for file images. Some file drivers allow + * the use of user-defined callbacks for allocating, freeing and + * copying the drivers internal buffer, potentially allowing a + * clever user to do optimizations such as avoiding large mallocs + * and memcpys or to perform detailed logging. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pset_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr) +{ + H5P_genplist_t *fapl; /* Property list pointer */ + H5FD_file_image_info_t info; /* File image info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + + /* Get the plist structure */ + if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get old info */ + if(H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get old file image info") + + /* verify file image field consistancy */ + HDassert(((info.buffer != NULL) && (info.size > 0)) || + ((info.buffer == NULL) && (info.size == 0))); + + /* Make sure a file image hasn't already been set */ + if(info.buffer != NULL || info.size > 0) + HGOTO_ERROR(H5E_PLIST, H5E_SETDISALLOWED, FAIL, "setting callbacks when an image is already set is forbidden. It could cause memory leaks.") + + /* verify that callbacks_ptr is not NULL */ + if(NULL == callbacks_ptr) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + + /* Make sure udata callbacks are going to be set if udata is going to be set */ + if(callbacks_ptr->udata) + if(callbacks_ptr->udata_copy == NULL || callbacks_ptr->udata_free == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_SETDISALLOWED, FAIL, "udata callbacks must be set if udata is set") + + /* Release old udata if it exists */ + if(info.callbacks.udata != NULL) { + HDassert(info.callbacks.udata_free); + if(info.callbacks.udata_free(info.callbacks.udata) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + } /* end if */ + + /* Update struct */ + info.callbacks = *callbacks_ptr; + + if(callbacks_ptr->udata) { + HDassert(callbacks_ptr->udata_copy); + HDassert(callbacks_ptr->udata_free); + if((info.callbacks.udata = callbacks_ptr->udata_copy(callbacks_ptr->udata)) == NULL) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy the suppplied udata") + } /* end if */ + + /* Set values */ + if(H5P_set(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file image info") + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pset_file_image_callbacks() */ + + +/*------------------------------------------------------------------------- + * Function: H5Pget_file_image_callbacks + * + * Purpose: Sets the callbacks for file images. Some file drivers allow + * the use of user-defined callbacks for allocating, freeing and + * copying the drivers internal buffer, potentially allowing a + * clever user to do optimizations such as avoiding large mallocs + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5Pget_file_image_callbacks(hid_t fapl_id, H5FD_file_image_callbacks_t *callbacks_ptr) +{ + H5P_genplist_t *fapl; /* Property list pointer */ + H5FD_file_image_info_t info; /* File image info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*x", fapl_id, callbacks_ptr); + + /* Get the plist structure */ + if(NULL == (fapl = H5P_object_verify(fapl_id, H5P_FILE_ACCESS))) + HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") + + /* Get old info */ + if(H5P_get(fapl, H5F_ACS_FILE_IMAGE_INFO_NAME, &info) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file image info") + + /* verify file image field consistancy */ + HDassert(((info.buffer != NULL) && (info.size > 0)) || + ((info.buffer == NULL) && (info.size == 0))); + + /* verify that callbacks_ptr is not NULL */ + if(NULL == callbacks_ptr) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "NULL callbacks_ptr") + + /* Transfer values to parameters */ + *callbacks_ptr = info.callbacks; + + /* Copy udata if it exists */ + if(info.callbacks.udata != NULL) { + HDassert(info.callbacks.udata_copy); + if((callbacks_ptr->udata = info.callbacks.udata_copy(info.callbacks.udata)) == 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't copy udata") + } /* end if */ + +done: + FUNC_LEAVE_API(ret_value) +} /* end H5Pget_file_image_callbacks() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_file_image_info_del + * + * Purpose: Delete callback for the file image info property, called + * when the property is deleted from the plist. The buffer + * and udata may need to be freed, possibly using their + * respective callbacks so the default free won't work. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5P_file_image_info_del(hid_t UNUSED prop_id, const char UNUSED *name, size_t UNUSED size, void *value) +{ + H5FD_file_image_info_t info; /* Image info struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + if(value) { + info = *(H5FD_file_image_info_t *)value; + + /* verify file image field consistancy */ + HDassert(((info.buffer != NULL) && (info.size > 0)) || + ((info.buffer == NULL) && (info.size == 0))); + + if(info.buffer && info.size > 0) { + /* Free buffer */ + if(info.callbacks.image_free) { + if(info.callbacks.image_free(info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, info.callbacks.udata) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed") + } /* end if */ + else + free(info.buffer); + } /* end if */ + + /* Free udata if it exists */ + if(info.callbacks.udata) { + if(NULL == info.callbacks.udata_free) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_free not defined") + + if(info.callbacks.udata_free(info.callbacks.udata) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + } /* end if */ + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_file_image_info_del() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_file_image_info_copy + * + * Purpose: Copy callback for the file image info property. The buffer + * and udata may need to be copied, possibly using their + * respective callbacks so the default copy won't work. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5P_file_image_info_copy(const char UNUSED *name, size_t UNUSED size, void *value) +{ + H5FD_file_image_info_t *info; /* Image info struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + if(value) { + info = (H5FD_file_image_info_t *)value; + + /* verify file image field consistancy */ + HDassert(((info->buffer != NULL) && (info->size > 0)) || + ((info->buffer == NULL) && (info->size == 0))); + + if(info->buffer && info->size > 0) { + void *old_buffer; /* Pointer to old image buffer */ + + /* Store the old buffer */ + old_buffer = info->buffer; + + /* Allocate new buffer */ + if(info->callbacks.image_malloc) { + if(NULL == (info->buffer = info->callbacks.image_malloc(info->size, + H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, info->callbacks.udata))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "image malloc callback failed") + } /* end if */ + else { + if(NULL == (info->buffer = H5MM_malloc(info->size))) + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block") + } /* end else */ + + /* Copy data to new buffer */ + if(info->callbacks.image_memcpy) { + if(info->buffer != info->callbacks.image_memcpy(info->buffer, old_buffer, + info->size, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, + info->callbacks.udata)) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCOPY, FAIL, "image_memcpy callback failed") + } /* end if */ + else + HDmemcpy(info->buffer, old_buffer, info->size); + } /* end if */ + } /* end if */ + + /* Copy udata if it exists */ + if(info->callbacks.udata) { + void *old_udata = info->callbacks.udata; + + if(NULL == info->callbacks.udata_copy) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_copy not defined") + + info->callbacks.udata = info->callbacks.udata_copy(old_udata); + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_file_image_info_copy() */ + + +/*------------------------------------------------------------------------- + * Function: H5P_file_image_info_close + * + * Purpose: Close callback for the file image info property. The buffer + * and udata may need to be freed, possibly using their + * respective callbacks so the standard free won't work. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Jacob Gruber + * Thurday, August 11, 2011 + * + *------------------------------------------------------------------------- + */ +herr_t +H5P_file_image_info_close(const char UNUSED *name, size_t UNUSED size, void *value) +{ + H5FD_file_image_info_t info; /* Image info struct */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + if(value) { + info = *(H5FD_file_image_info_t *)value; + + if(info.buffer != NULL && info.size > 0) { + /* Free buffer */ + if(info.callbacks.image_free) { + if(info.callbacks.image_free(info.buffer, H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, + info.callbacks.udata) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "image_free callback failed") + } /* end if */ + else + H5MM_xfree(info.buffer); + } /* end if */ + } /* end if */ + + /* Free udata if it exists */ + if(info.callbacks.udata) { + if(NULL == info.callbacks.udata_free) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "udata_free not defined") + if(info.callbacks.udata_free(info.callbacks.udata) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "udata_free callback failed") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5P_file_image_info_close() */ + diff --git a/src/H5Pint.c b/src/H5Pint.c index 08b8af6..46a06a0 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -51,6 +51,7 @@ typedef struct { const H5P_genclass_t *parent; /* Pointer to parent class */ const char *name; /* Pointer to name to check */ + H5P_genclass_t *new_class; /* Pointer to class during path traversal */ } H5P_check_class_t; @@ -1358,11 +1359,11 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) /*-------------------------------------------------------------------------- NAME - H5P_check_class + H5P_open_class_path_cb PURPOSE Internal callback routine to check for duplicated names in parent class. USAGE - int H5P_check_class(obj, id, key) + int H5P_open_class_path_cb(obj, id, key) H5P_genclass_t *obj; IN: Pointer to class hid_t id; IN: ID of object being looked at const void *key; IN: Pointer to information used to compare @@ -1378,27 +1379,29 @@ H5P_access_class(H5P_genclass_t *pclass, H5P_class_mod_t mod) REVISION LOG --------------------------------------------------------------------------*/ static int -H5P_check_class(void *_obj, hid_t UNUSED id, void *_key) +H5P_open_class_path_cb(void *_obj, hid_t UNUSED id, void *_key) { - H5P_genclass_t *obj=(H5P_genclass_t *)_obj; /* Pointer to the class for this ID */ - const H5P_check_class_t *key=(const H5P_check_class_t *)_key; /* Pointer to key information for comparison */ - int ret_value=0; /* Return value */ + H5P_genclass_t *obj = (H5P_genclass_t *)_obj; /* Pointer to the class for this ID */ + H5P_check_class_t *key = (H5P_check_class_t *)_key; /* Pointer to key information for comparison */ + int ret_value = 0; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOERR HDassert(obj); - HDassert(H5I_GENPROP_CLS==H5I_get_type(id)); + HDassert(H5I_GENPROP_CLS == H5I_get_type(id)); HDassert(key); /* Check if the class object has the same parent as the new class */ - if(obj->parent==key->parent) { + if(obj->parent == key->parent) { /* Check if they have the same name */ - if(HDstrcmp(obj->name,key->name)==0) - ret_value=1; /* Indicate a match */ + if(HDstrcmp(obj->name, key->name) == 0) { + key->new_class = obj; + ret_value = 1; /* Indicate a match */ + } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5P_check_class() */ +} /* end H5P_open_class_path_cb() */ /*-------------------------------------------------------------------------- @@ -4555,8 +4558,8 @@ H5P_open_class_path(const char *path) char *curr_name; /* Pointer to current component of path name */ char *delimit; /* Pointer to path delimiter during traversal */ H5P_genclass_t *curr_class; /* Pointer to class during path traversal */ - H5P_genclass_t *ret_value; /* Return value */ H5P_check_class_t check_info; /* Structure to hold the information for checking duplicate names */ + H5P_genclass_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -4569,20 +4572,24 @@ H5P_open_class_path(const char *path) /* Find the generic property class with this full path */ curr_name = tmp_path; curr_class = NULL; - while((delimit=HDstrchr(curr_name,'/'))!=NULL) { + while(NULL != (delimit = HDstrchr(curr_name, '/'))) { /* Change the delimiter to terminate the string */ - *delimit='\0'; + *delimit = '\0'; /* Set up the search structure */ - check_info.parent=curr_class; - check_info.name=curr_name; + check_info.parent = curr_class; + check_info.name = curr_name; + check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if(NULL == (curr_class = (H5P_genclass_t *)H5I_search(H5I_GENPROP_CLS, H5P_check_class, &check_info, FALSE))) - HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class") + if(H5I_iterate(H5I_GENPROP_CLS, H5P_open_class_path_cb, &check_info, FALSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes") + else if(NULL == check_info.new_class) + HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class") /* Advance the pointer in the path to the start of the next component */ - curr_name=delimit+1; + curr_class = check_info.new_class; + curr_name = delimit + 1; } /* end while */ /* Should be pointing to the last component in the path name now... */ @@ -4590,13 +4597,16 @@ H5P_open_class_path(const char *path) /* Set up the search structure */ check_info.parent = curr_class; check_info.name = curr_name; + check_info.new_class = NULL; /* Find the class with this name & parent by iterating over the open classes */ - if(NULL == (curr_class = (H5P_genclass_t *)H5I_search(H5I_GENPROP_CLS, H5P_check_class, &check_info, FALSE))) + if(H5I_iterate(H5I_GENPROP_CLS, H5P_open_class_path_cb, &check_info, FALSE) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_BADITER, NULL, "can't iterate over classes") + else if(NULL == check_info.new_class) HGOTO_ERROR(H5E_PLIST, H5E_NOTFOUND, NULL, "can't locate class") /* Copy it */ - if(NULL == (ret_value = H5P_copy_pclass(curr_class))) + if(NULL == (ret_value = H5P_copy_pclass(check_info.new_class))) HGOTO_ERROR(H5E_PLIST, H5E_CANTCOPY, NULL, "can't copy property class") done: @@ -4604,7 +4614,7 @@ done: H5MM_xfree(tmp_path); FUNC_LEAVE_NOAPI(ret_value) -} /* H5P_open_class_path() */ +} /* H5P_open_class_path() */ /*-------------------------------------------------------------------------- diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 9015940..654772a 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -322,6 +322,12 @@ H5_DLL herr_t H5Pget_libver_bounds(hid_t plist_id, H5F_libver_t *low, H5F_libver_t *high); H5_DLL herr_t H5Pset_elink_file_cache_size(hid_t plist_id, unsigned efc_size); H5_DLL herr_t H5Pget_elink_file_cache_size(hid_t plist_id, unsigned *efc_size); +H5_DLL herr_t H5Pset_file_image(hid_t fapl_id, void *buf_ptr, size_t buf_len); +H5_DLL herr_t H5Pget_file_image(hid_t fapl_id, void **buf_ptr_ptr, size_t *buf_len_ptr); +H5_DLL herr_t H5Pset_file_image_callbacks(hid_t fapl_id, + H5FD_file_image_callbacks_t *callbacks_ptr); +H5_DLL herr_t H5Pget_file_image_callbacks(hid_t fapl_id, + H5FD_file_image_callbacks_t *callbacks_ptr); /* Dataset creation property list (DCPL) routines */ H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout); diff --git a/src/H5T.c b/src/H5T.c index fcc4ab3..37d4b68 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -1449,7 +1449,8 @@ H5T_term_interface(void) H5T_g.asoft = 0; /* Unlock all datatypes, then free them */ - H5I_search(H5I_DATATYPE, H5T_unlock_cb, NULL, FALSE); + /* note that we are ignoring the return value from H5I_iterate() */ + H5I_iterate(H5I_DATATYPE, H5T_unlock_cb, NULL, FALSE); H5I_dec_type_ref(H5I_DATATYPE); /* Reset all the datatype IDs */ diff --git a/src/H5err.txt b/src/H5err.txt index 71d27a6..b4cb28b 100644 --- a/src/H5err.txt +++ b/src/H5err.txt @@ -220,6 +220,7 @@ MINOR, DSPACE, H5E_CANTCOMPARE, Can't compare objects MINOR, PLIST, H5E_CANTGET, Can't get value MINOR, PLIST, H5E_CANTSET, Can't set value MINOR, PLIST, H5E_DUPCLASS, Duplicate class name in parent class +MINOR, PLIST, H5E_SETDISALLOWED, Disallowed operation # Link errors MINOR, LINK, H5E_TRAVERSE, Link traversal failure diff --git a/test/Makefile.am b/test/Makefile.am index afc1b37..50ca89c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -42,7 +42,7 @@ TEST_PROG= testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe \ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap + freespace mf farray earray btree2 fheap file_image # List programs to be built when testing here. error_test and err_compat are # built at the same time as the other tests, but executed by testerror.sh. @@ -63,7 +63,7 @@ check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version testmeta links_ BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ - gen_sizes_lheap + gen_sizes_lheap gen_file_image if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) diff --git a/test/Makefile.in b/test/Makefile.in index 6e716bc..d468cd9 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -92,7 +92,8 @@ am__EXEEXT_1 = testhdf5$(EXEEXT) lheap$(EXEEXT) ohdr$(EXEEXT) \ ttsafe$(EXEEXT) getname$(EXEEXT) vfd$(EXEEXT) ntypes$(EXEEXT) \ dangle$(EXEEXT) dtransform$(EXEEXT) reserved$(EXEEXT) \ cross_read$(EXEEXT) freespace$(EXEEXT) mf$(EXEEXT) \ - farray$(EXEEXT) earray$(EXEEXT) btree2$(EXEEXT) fheap$(EXEEXT) + farray$(EXEEXT) earray$(EXEEXT) btree2$(EXEEXT) fheap$(EXEEXT) \ + file_image$(EXEEXT) am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_cross$(EXEEXT) gen_deflate$(EXEEXT) gen_filters$(EXEEXT) \ gen_new_array$(EXEEXT) gen_new_fill$(EXEEXT) \ @@ -100,7 +101,7 @@ am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_new_super$(EXEEXT) gen_noencoder$(EXEEXT) \ gen_nullspace$(EXEEXT) gen_udlinks$(EXEEXT) \ space_overflow$(EXEEXT) gen_filespace$(EXEEXT) \ - gen_specmetaread$(EXEEXT) gen_sizes_lheap$(EXEEXT) + gen_specmetaread$(EXEEXT) gen_sizes_lheap$(EXEEXT) gen_file_image$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) accum_SOURCES = accum.c accum_OBJECTS = accum.$(OBJEXT) @@ -198,6 +199,10 @@ fheap_SOURCES = fheap.c fheap_OBJECTS = fheap.$(OBJEXT) fheap_LDADD = $(LDADD) fheap_DEPENDENCIES = libh5test.la $(LIBHDF5) +file_image_SOURCES = file_image.c +file_image_OBJECTS = file_image.$(OBJEXT) +file_image_LDADD = $(LDADD) +file_image_DEPENDENCIES = libh5test.la $(LIBHDF5) fillval_SOURCES = fillval.c fillval_OBJECTS = fillval.$(OBJEXT) fillval_LDADD = $(LDADD) @@ -282,6 +287,10 @@ gen_udlinks_SOURCES = gen_udlinks.c gen_udlinks_OBJECTS = gen_udlinks.$(OBJEXT) gen_udlinks_LDADD = $(LDADD) gen_udlinks_DEPENDENCIES = libh5test.la $(LIBHDF5) +gen_file_image_SOURCES = gen_file_image.c +gen_file_image_OBJECTS = gen_file_image.$(OBJEXT) +gen_file_image_LDADD = $(LDADD) +gen_file_image_DEPENDENCIES = libh5test.la $(LIBHDF5) getname_SOURCES = getname.c getname_OBJECTS = getname.$(OBJEXT) getname_LDADD = $(LDADD) @@ -418,31 +427,32 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ btree2.c cache.c cache_api.c cache_tagging.c cmpd_dset.c \ cross_read.c dangle.c dsets.c dt_arith.c dtransform.c dtypes.c \ earray.c efc.c enum.c err_compat.c error_test.c extend.c \ - external.c farray.c fheap.c fillval.c filter_fail.c flush1.c \ - flush2.c freespace.c gen_bad_ohdr.c gen_bogus.c gen_cross.c \ - gen_deflate.c gen_filespace.c gen_filters.c gen_new_array.c \ - gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \ - gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \ - gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ - istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ - ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ - space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ - testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c -DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ - bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ - cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ - dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \ - error_test.c extend.c external.c farray.c fheap.c fillval.c \ + external.c farray.c fheap.c file_image.c fillval.c \ filter_fail.c flush1.c flush2.c freespace.c gen_bad_ohdr.c \ gen_bogus.c gen_cross.c gen_deflate.c gen_filespace.c \ gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \ gen_new_mtime.c gen_new_super.c gen_noencoder.c \ gen_nullspace.c gen_sizes_lheap.c gen_specmetaread.c \ - gen_udlinks.c getname.c gheap.c hyperslab.c istore.c lheap.c \ + gen_udlinks.c gen_file_image.c getname.c gheap.c hyperslab.c istore.c lheap.c \ links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \ tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ $(ttsafe_SOURCES) unlink.c vfd.c +DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ + bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ + cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ + dtransform.c dtypes.c earray.c efc.c enum.c err_compat.c \ + error_test.c extend.c external.c farray.c fheap.c file_image.c \ + fillval.c filter_fail.c flush1.c flush2.c freespace.c \ + gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \ + gen_filespace.c gen_filters.c gen_new_array.c gen_new_fill.c \ + gen_new_group.c gen_new_mtime.c gen_new_super.c \ + gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \ + gen_specmetaread.c gen_udlinks.c gen_file_image.c getname.c gheap.c hyperslab.c \ + istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ + ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ + space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ + testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c ETAGS = etags CTAGS = ctags am__tty_colors = \ @@ -778,7 +788,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ big mtime fillval mount flush1 flush2 app_ref enum \ set_extent ttsafe \ getname vfd ntypes dangle dtransform reserved cross_read \ - freespace mf farray earray btree2 fheap + freespace mf farray earray btree2 fheap file_image # These programs generate test files for the tests. They don't need to be @@ -791,7 +801,7 @@ TEST_PROG = testhdf5 lheap ohdr stab gheap cache cache_api cache_tagging \ BUILD_ALL_PROGS = gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ - gen_sizes_lheap + gen_sizes_lheap gen_file_image # The libh5test library provides common support code for the tests. @@ -978,6 +988,9 @@ farray$(EXEEXT): $(farray_OBJECTS) $(farray_DEPENDENCIES) fheap$(EXEEXT): $(fheap_OBJECTS) $(fheap_DEPENDENCIES) @rm -f fheap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fheap_OBJECTS) $(fheap_LDADD) $(LIBS) +file_image$(EXEEXT): $(file_image_OBJECTS) $(file_image_DEPENDENCIES) + @rm -f file_image$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(file_image_OBJECTS) $(file_image_LDADD) $(LIBS) fillval$(EXEEXT): $(fillval_OBJECTS) $(fillval_DEPENDENCIES) @rm -f fillval$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fillval_OBJECTS) $(fillval_LDADD) $(LIBS) @@ -1041,6 +1054,9 @@ gen_specmetaread$(EXEEXT): $(gen_specmetaread_OBJECTS) $(gen_specmetaread_DEPEND gen_udlinks$(EXEEXT): $(gen_udlinks_OBJECTS) $(gen_udlinks_DEPENDENCIES) @rm -f gen_udlinks$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_udlinks_OBJECTS) $(gen_udlinks_LDADD) $(LIBS) +gen_file_image$(EXEEXT): $(gen_file_image_OBJECTS) $(gen_file_image_DEPENDENCIES) + @rm -f gen_file_image$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gen_file_image_OBJECTS) $(gen_file_image_LDADD) $(LIBS) getname$(EXEEXT): $(getname_OBJECTS) $(getname_DEPENDENCIES) @rm -f getname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getname_OBJECTS) $(getname_LDADD) $(LIBS) @@ -1145,6 +1161,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/external.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/farray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fheap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fillval.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter_fail.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flush1.Po@am__quote@ @@ -1166,6 +1183,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_sizes_lheap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_specmetaread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_udlinks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gheap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5test.Plo@am__quote@ diff --git a/test/file_image.c b/test/file_image.c new file mode 100644 index 0000000..7c2c3ff --- /dev/null +++ b/test/file_image.c @@ -0,0 +1,1335 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/*********************************************************** +* +* Test program: file_image +* +* Test setting file images +* +*************************************************************/ + +#include "h5test.h" +#include "H5srcdir.h" +#include "H5Fprivate.h" /* required to test property removals */ +#define VERIFY(condition, string) do { if (!(condition)) FAIL_PUTS_ERROR(string) } while(0) + +/* Values for callback bit field */ +#define MALLOC 0x01 +#define MEMCPY 0x02 +#define REALLOC 0x04 +#define FREE 0x08 +#define UDATA_COPY 0x10 +#define UDATA_FREE 0x20 + +#define RANK 2 +#define DIM0 1024 +#define DIM1 32 +#define DSET_NAME "test_dset" + +#define FAMILY_SIZE (2 * 1024) + +const char *FILENAME[] = { + "file_image_core_test", + NULL +}; + +/* need a second file name array, as the first file name array contains + * files we don't want to delete on cleanup. + */ +const char *FILENAME2[] = { + "sec2_get_file_image_test", + "stdio_get_file_image_test", + "core_get_file_image_test", + "family_get_file_image_test", + "multi_get_file_image_test", + "split_get_file_image_test", + "get_file_image_error_rejection_test", + NULL +}; + +typedef struct { + unsigned char used_callbacks; /* Bitfield for tracking callbacks */ + H5FD_file_image_op_t malloc_src; /* Source of file image callbacks */ + H5FD_file_image_op_t memcpy_src; + H5FD_file_image_op_t realloc_src; + H5FD_file_image_op_t free_src; +} udata_t; + + +/****************************************************************************** + * Function: test_properties + * + * Purpose: Tests that the file image properties (buffer pointer and length) + * are set properly. Image callbacks are not set in this test. + * + * Returns: Success: 0 + * Failure: 1 + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static int +test_properties(void) +{ + hid_t fapl_1; + hid_t fapl_2; + char *buffer; + int count = 10; + void *temp; + char *temp2; + int i; + size_t size; + size_t temp_size; + + TESTING("File image property list functions"); + + /* Initialize file image buffer + * + * Note: this image will not contain a valid HDF5 file, as it complicates testing + * property list functions. In the file driver tests further down, this will + * not be the case. + */ + size = (size_t)count * sizeof(char); + buffer = (char *)HDmalloc(size); + for(i = 0; i < count - 1; i++) + buffer[i] = (char)(65 + i); + buffer[count] = '\0'; + + /* Create fapl */ + if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR + + /* Get file image stuff */ + if(H5Pget_file_image(fapl_1, (void **)&temp, &temp_size) < 0) FAIL_STACK_ERROR + + /* Check default values */ + VERIFY(temp == NULL, "Default pointer is wrong"); + VERIFY(temp_size == 0, "Default size is wrong"); + + /* Set file image stuff */ + if(H5Pset_file_image(fapl_1, (void *)buffer, size) < 0) FAIL_STACK_ERROR + + /* Get the same */ + if(H5Pget_file_image(fapl_1, (void **)&temp, &temp_size) < 0) FAIL_STACK_ERROR + + /* Check that sizes are the same, and that the buffers are identical but separate */ + VERIFY(temp != NULL, "temp is null!"); + VERIFY(temp_size == size, "Sizes of buffers don't match"); + VERIFY(temp != buffer, "Retrieved buffer is the same as original"); + VERIFY(0 == HDmemcmp(temp, buffer, size), "Buffers contain different data"); + + /* Copy the fapl */ + if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR + + /* Get values from the new fapl */ + if(H5Pget_file_image(fapl_2, (void **)&temp2, &temp_size) < 0) FAIL_STACK_ERROR + + /* Check that sizes are the same, and that the buffers are identical but separate */ + VERIFY(temp_size == size,"Sizes of buffers don't match"); + VERIFY(temp2 != NULL,"Recieved buffer not set"); + VERIFY(temp2 != buffer, "Retrieved buffer is the same as original"); + VERIFY(temp2 != temp, "Retrieved buffer is the same as previously retrieved buffer"); + VERIFY(0 == HDmemcmp(temp2, buffer, size),"Buffers contain different data"); + + /* Close everything */ + if(H5Pclose(fapl_1) < 0) FAIL_STACK_ERROR + if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR + HDfree(buffer); + HDfree(temp); + HDfree(temp2); + + PASSED(); + return 0; + +error: + return 1; +} /* end test_properties() */ + +/****************************************************************************** + * Function: malloc_cb + * + * Purpose: This function allows calls to the malloc callback to be tracked. + * + * Returns: The result of a standard malloc + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static void * +malloc_cb(size_t size, H5FD_file_image_op_t op, void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= MALLOC; + u->malloc_src = op; + return HDmalloc(size); +} + +/****************************************************************************** + * Function: memcpy_cb + * + * Purpose: This function allows calls to the memcpy callback to be tracked. + * + * Returns: The result of a standard memcpy + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static void * +memcpy_cb(void *dest, const void *src, size_t size, H5FD_file_image_op_t op, void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= MEMCPY; + u->memcpy_src = op; + return HDmemcpy(dest, src, size); +} + +/****************************************************************************** + * Function: realloc_cb + * + * Purpose: This function allows calls to the realloc callback to be tracked. + * + * Returns: The result of a standard realloc + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static void * +realloc_cb(void *ptr, size_t size, H5FD_file_image_op_t op, void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= REALLOC; + u->realloc_src = op; + return HDrealloc(ptr,size); +} + +/****************************************************************************** + * Function: free_cb + * + * Purpose: This function allows calls to the free callback to be tracked. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static herr_t +free_cb(void *ptr, H5FD_file_image_op_t op, void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= FREE; + u->free_src = op; + HDfree(ptr); + return(SUCCEED); +} + +/****************************************************************************** + * Function: udata_copy_cb + * + * Purpose: This function allows calls to the udata_copy callback to be tracked. + * No copying actualy takes place; it is easier to deal with only one + * instance of the udata. + * + * Returns: A pointer to the same udata that was passed in. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static void * +udata_copy_cb(void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= UDATA_COPY; + return udata; +} + +/****************************************************************************** + * Function: udata_free_cb + * + * Purpose: This function allows calls to the udata_free callback to be tracked. + * + * Note: this callback doesn't actually do anything. Since the + * udata_copy callback doesn't copy, only one instance of the udata + * is kept alive and such it must be freed explicitly at the end of the tests. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static herr_t +udata_free_cb(void *udata) +{ + udata_t *u = (udata_t *)udata; + + u->used_callbacks |= UDATA_FREE; + return(SUCCEED); +} + +/****************************************************************************** + * Function: reset_udata + * + * Purpose: Resets the udata to default values. This facilitates storing only + * the results of a single operation in the udata. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static void +reset_udata(udata_t *u) +{ + u->used_callbacks = 0; + u->malloc_src = u->memcpy_src = u->realloc_src = u->free_src = H5FD_FILE_IMAGE_OP_NO_OP; +} + +/****************************************************************************** + * Function: test_callbacks + * + * Purpose: Tests that callbacks are called properly in property list functions. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static int +test_callbacks(void) +{ + H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + H5FD_file_image_callbacks_t callbacks; + hid_t fapl_1; + hid_t fapl_2; + udata_t *udata; + char *file_image; + char *temp_file_image; + int count = 10; + int i; + size_t size; + size_t temp_size; + + TESTING("Callback use in property list operations"); + + /* Allocate and initialize udata */ + udata = (udata_t *)HDmalloc(sizeof(udata_t)); + reset_udata(udata); + + /* copy the address of the user data into read_callbacks */ + real_callbacks.udata = (void *)udata; + + /* Allocate and initialize file image buffer */ + size = (size_t)count * sizeof(char); + file_image = (char *)HDmalloc(size); + for(i = 0; i < count - 1; i++) + file_image[i] = (char)(65 + i); + file_image[count] = '\0'; + + /* Create fapl */ + if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR + + /* Get file image stuff */ + callbacks = real_callbacks; + if(H5Pget_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR + + /* Check default values */ + VERIFY(callbacks.image_malloc == NULL, "Default malloc callback is wrong"); + VERIFY(callbacks.image_memcpy == NULL, "Default memcpy callback is wrong"); + VERIFY(callbacks.image_realloc == NULL, "Default realloc callback is wrong"); + VERIFY(callbacks.image_free == NULL, "Default free callback is wrong"); + VERIFY(callbacks.udata_copy == NULL, "Default udata copy callback is wrong"); + VERIFY(callbacks.udata_free == NULL, "Default udata free callback is wrong"); + VERIFY(callbacks.udata == NULL, "Default udata is wrong"); + + + /* Set file image callbacks */ + callbacks = real_callbacks; + if(H5Pset_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR + + /* Get file image callbacks */ + callbacks = null_callbacks; + if(H5Pget_file_image_callbacks(fapl_1, &callbacks) < 0) FAIL_STACK_ERROR + + /* Verify values */ + VERIFY(callbacks.image_malloc == &malloc_cb, "malloc callback was not set or retrieved properly"); + VERIFY(callbacks.image_memcpy == &memcpy_cb, "memcpy callback was not set or retrieved properly"); + VERIFY(callbacks.image_realloc == &realloc_cb, "realloc callback was not set or retrieved properly"); + VERIFY(callbacks.image_free == &free_cb, "free callback was not set or retrieved properly"); + VERIFY(callbacks.udata_copy == &udata_copy_cb, "udata copy callback was not set or retrieved properly"); + VERIFY(callbacks.udata_free == &udata_free_cb, "udata free callback was not set or retrieved properly"); + VERIFY(callbacks.udata == udata, "udata was not set or retrieved properly"); + + + /* + * Check callbacks in internal function without a previously set file image + */ + + /* Copy fapl */ + reset_udata(udata); + if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR + + /* Verify that the property's copy callback used the correct image callbacks */ + VERIFY(udata->used_callbacks == (UDATA_COPY), "Copying a fapl with no image used incorrect callbacks"); + + /* Close fapl */ + reset_udata(udata); + if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR + + /* Verify that the udata free callback was used */ + VERIFY(udata->used_callbacks == (UDATA_FREE), "Closing a fapl with no image used incorrect callbacks"); + + /* Copy again */ + if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR + + /* Remove property from fapl */ + reset_udata(udata); + if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR + + /* Verify that the property's delete callback was called using the correct image callbacks */ + VERIFY(udata->used_callbacks == (UDATA_FREE), "Removing a property from a fapl with no image used incorrect callbacks"); + + /* Close it again */ + if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR + + /* Get file image */ + reset_udata(udata); + if(H5Pget_file_image(fapl_1, (void **)&temp_file_image, &temp_size) < 0) FAIL_STACK_ERROR + + /* Verify that the correct callbacks were used */ + VERIFY(udata->used_callbacks == 0, "attempting to retrieve the image from a fapl without an image has an unexpected callback"); + + /* Set file image */ + reset_udata(udata); + if(H5Pset_file_image(fapl_1, (void *)file_image, size) < 0) FAIL_STACK_ERROR + + VERIFY(udata->used_callbacks == (MALLOC | MEMCPY), "Setting a file image (first time) used incorrect callbacks"); + + /* + * Check callbacks in internal functions with a previously set file image + */ + + /* Copy fapl */ + reset_udata(udata); + if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR + + /* Verify that the property's copy callback used the correct image callbacks */ + VERIFY(udata->used_callbacks == (MALLOC | MEMCPY | UDATA_COPY), "Copying a fapl with an image used incorrect callbacks"); + VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, "malloc callback has wrong source"); + VERIFY(udata->memcpy_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_COPY, "memcpy callback has wrong source"); + + /* Close fapl */ + reset_udata(udata); + if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR + + /* Verify that the udata free callback was used */ + VERIFY(udata->used_callbacks == (FREE | UDATA_FREE), "Closing a fapl with an image used incorrect callbacks"); + VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, "free callback has wrong source"); + + /* Copy again */ + if((fapl_2 = H5Pcopy(fapl_1)) < 0) FAIL_STACK_ERROR + + /* Remove property from fapl */ + reset_udata(udata); + if(H5Premove(fapl_2, H5F_ACS_FILE_IMAGE_INFO_NAME) < 0) FAIL_STACK_ERROR + + /* Verify that the property's delete callback was called using the correct image callbacks */ + VERIFY(udata->used_callbacks == (FREE | UDATA_FREE), "Removing a property from a fapl with an image used incorrect callbacks"); + VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_CLOSE, "free callback has wrong source"); + + /* Close it again */ + if(H5Pclose(fapl_2) < 0) FAIL_STACK_ERROR + + /* Get file image */ + reset_udata(udata); + if(H5Pget_file_image(fapl_1, (void **)&temp_file_image, &temp_size) < 0) FAIL_STACK_ERROR + + /* Verify that the correct callbacks were used */ + VERIFY(udata->used_callbacks == (MALLOC | MEMCPY), "attempting to retrieve the image from a fapl with an image has an unexpected callback"); + VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, "malloc callback has wrong source"); + VERIFY(udata->memcpy_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_GET, "memcpy callback has wrong source"); + + /* Set file image */ + reset_udata(udata); + if(H5Pset_file_image(fapl_1, (void *)file_image, size) < 0) FAIL_STACK_ERROR + + VERIFY(udata->used_callbacks == (FREE | MALLOC | MEMCPY), "Setting a file image (second time) used incorrect callbacks"); + VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, "malloc callback has wrong source"); + VERIFY(udata->memcpy_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, "memcpy callback has wrong source"); + VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_PROPERTY_LIST_SET, "freec callback has wrong source"); + + /* Close stuff */ + if(H5Pclose(fapl_1) < 0) FAIL_STACK_ERROR + HDfree(file_image); + HDfree(temp_file_image); + HDfree(udata); + + PASSED(); + return 0; + +error: + return 1; +} /* test_callbacks() */ + +/****************************************************************************** + * Function: test_core + * + * Purpose: Tests that callbacks are called properly in the core VFD and + * that the initial file image works properly. + * + * Programmer: Jacob Gruber + * Monday, August 22, 2011 + * + ****************************************************************************** + */ +static int +test_core(void) +{ + hid_t fapl; + hid_t file; + hid_t dset; + hid_t space; + udata_t *udata; + unsigned char *file_image; + char filename[1024]; + char src_dir_filename[1024]; + const char *tmp = NULL; + size_t size; + hsize_t dims[2]; + int fd; + h5_stat_t sb; + herr_t ret; + H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + + TESTING("Initial file image and callbacks in Core VFD"); + + /* Create fapl */ + fapl = h5_fileaccess(); + VERIFY(fapl >= 0, "fapl creation failed"); + + /* Set up the core VFD */ + ret = H5Pset_fapl_core(fapl, 0, 0); + VERIFY(ret >= 0, "setting core driver in fapl failed"); + + tmp = h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + VERIFY(tmp != NULL, "h5_fixname failed"); + + /* convert file name to srcdir file name. Make a copy as + * H5_get_srcdir_filename() simply sets up the file name in its + * own buffer each time it is called -- overwriting the previous + * value. + */ + tmp = H5_get_srcdir_filename(filename); + VERIFY(tmp != NULL, "H5_get_srcdir_filename failed"); + VERIFY(strlen(tmp) < 1023, "srcdir file name too long."); + HDstrncpy(src_dir_filename, tmp, 1023); + src_dir_filename[1023] = '\0'; + + /* Allocate and initialize udata */ + udata = (udata_t *)HDmalloc(sizeof(udata_t)); + VERIFY(udata != NULL, "udata malloc failed"); + + /* copy the address of the udata into the callbacks structure */ + callbacks.udata = (void *)udata; + + /* Set file image callbacks */ + ret = H5Pset_file_image_callbacks(fapl, &callbacks); + VERIFY(ret >= 0, "set image callbacks failed"); + + /* Test open (no file image) */ + reset_udata(udata); + file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + VERIFY(file >= 0, "H5Fopen failed"); + VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks"); + VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open"); + + /* Close file */ + reset_udata(udata); + ret = H5Fclose(file); + VERIFY(ret >= 0, "H5Fclose failed"); + VERIFY(udata->used_callbacks == FREE, "Closing a core file used the wrong callbacks"); + VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); + + /* Reopen file */ + file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + VERIFY(file >= 0, "H5Fopen failed"); + + /* Set up a new dset */ + dims[0] = DIM0; + dims[1] = DIM1; + space = H5Screate_simple(RANK, dims, dims); + VERIFY(space >= 0, "H5Screate failed"); + + /* Create new dset, invoking H5FD_core_write */ + reset_udata(udata); + dset = H5Dcreate2(file, DSET_NAME, H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset >=0, "H5Dcreate failed"); + + /* Flush the write and check the realloc callback */ + ret = H5Fflush(file, H5F_SCOPE_LOCAL); + VERIFY(ret >= 0, "H5Fflush failed"); + VERIFY(udata->used_callbacks == (REALLOC), "core write used the wrong callbacks"); + VERIFY(udata->realloc_src == H5FD_FILE_IMAGE_OP_FILE_RESIZE, "Realloc callback came from wrong source in core write"); + + /* Close dset and space */ + ret = H5Dclose(dset); + VERIFY(ret >= 0, "H5Dclose failed"); + ret = H5Sclose(space); + VERIFY(ret >= 0, "H5Sclose failed"); + + /* Test file close */ + reset_udata(udata); + ret = H5Fclose(file); + VERIFY(ret >= 0, "H5Fclose failed"); + VERIFY(udata->used_callbacks == (FREE), "Closing a core file used the wrong callbacks"); + VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); + + /* Create file image buffer */ + fd = HDopen(src_dir_filename, O_RDONLY, 0666); + VERIFY(fd > 0, "open failed"); + ret = HDfstat(fd, &sb); + VERIFY(ret == 0, "fstat failed"); + size = (size_t)sb.st_size; + file_image = (unsigned char *)HDmalloc(size); + HDread(fd, file_image, size); + ret = HDclose(fd); + VERIFY(ret == 0, "close failed"); + + /* Set file image in plist */ + if(H5Pset_file_image(fapl, file_image, size) < 0) FAIL_STACK_ERROR + + /* Test open with file image */ + if((file = H5Fopen("dne.h5", H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if(H5Fclose(file) < 0) FAIL_STACK_ERROR + + /* Release resources */ + h5_cleanup(FILENAME, fapl); + HDfree(udata); + HDfree(file_image); + + PASSED(); + + return 0; + +error: + return 1; +} /* end test_core() */ + +/****************************************************************************** + * Function: test_get_file_image + * + * Purpose: Test the H5Fget_file_image() call. + * + * Programmer: John Mainzer + * Tuesday, November 15, 2011 + * + ****************************************************************************** + */ +static int +test_get_file_image(const char * test_banner, + const int file_name_num, + hid_t fapl) +{ + char file_name[1024] = "\0"; + void * insertion_ptr = NULL; + void * image_ptr = NULL; + void * file_image_ptr = NULL; + hbool_t is_family_file = FALSE; + hbool_t identical; + int data[100]; + int i; + int fd = -1; + int result; + hid_t driver = -1; + hid_t file_id = -1; + hid_t dset_id = -1; + hid_t space_id = -1; + hid_t core_fapl_id = -1; + hid_t core_file_id = -1; + herr_t err; + hsize_t dims[2]; + ssize_t bytes_read; + ssize_t image_size; + ssize_t file_size; + h5_stat_t stat_buf; + + TESTING(test_banner); + + /* set flag if we are dealing with a family file */ + driver = H5Pget_driver(fapl); + VERIFY(driver >= 0, "H5Pget_driver(fapl) failed"); + + if(driver == H5FD_FAMILY) + is_family_file = TRUE; + + /* setup the file name */ + h5_fixname(FILENAME2[file_name_num], fapl, file_name, sizeof(file_name)); + VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); + + /* create the file */ + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl); + VERIFY(file_id >= 0, "H5Fcreate() failed."); + + /* Set up data space for new new data set */ + dims[0] = 10; + dims[1] = 10; + space_id = H5Screate_simple(2, dims, dims); + VERIFY(space_id >= 0, "H5Screate() failed"); + + /* Create a dataset */ + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset_id >=0, "H5Dcreate() failed"); + + /* write some data to the data set */ + for (i = 0; i < 100; i++) + data[i] = i; + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, (void *)data); + VERIFY(err >= 0, "H5Dwrite() failed."); + + /* Flush the file */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VERIFY(err >= 0, "H5Fflush failed"); + + /* get the size of the file */ + image_size = H5Fget_file_image(file_id, NULL, (size_t)0); + VERIFY(image_size > 0, "H5Fget_file_image(1) failed."); + + /* allocate a buffer of the appropriate size */ + image_ptr = HDmalloc((size_t)image_size); + VERIFY(image_ptr != NULL, "HDmalloc(1) failed."); + + /* load the image of the file into the buffer */ + bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_size); + VERIFY(bytes_read == image_size, "H5Fget_file_image(2) failed."); + + /* Close dset and space */ + err = H5Dclose(dset_id); + VERIFY(err >= 0, "H5Dclose failed"); + err = H5Sclose(space_id); + VERIFY(err >= 0, "H5Sclose failed"); + + /* close the test file */ + err = H5Fclose(file_id); + VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); + + if(is_family_file) { + char member_file_name[1024]; + ssize_t bytes_to_read; + ssize_t member_size; + ssize_t size_remaining; + + i = 0; + file_size = 0; + + do { + HDsnprintf(member_file_name, 1024, file_name, i); + + /* get the size of the member file */ + result = HDstat(member_file_name, &stat_buf); + VERIFY(result == 0, "HDstat() failed."); + + member_size = (ssize_t)stat_buf.st_size; + + i++; + file_size += member_size; + } while(member_size > 0); + + /* Since we use the eoa to calculate the image size, the file size + * may be larger. This is OK, as long as (in this specialized instance) + * the remainder of the file is all '\0's. + */ + VERIFY(file_size >= image_size, "file size != image size."); + + /* allocate a buffer for the test file image */ + file_image_ptr = HDmalloc((size_t)file_size); + VERIFY(file_image_ptr != NULL, "HDmalloc(2f) failed."); + + size_remaining = image_size; + insertion_ptr = file_image_ptr; + i = 0; + + while(size_remaining > 0) { + /* construct the member file name */ + HDsnprintf(member_file_name, 1024, file_name, i); + + /* open the test file using standard I/O calls */ + fd = HDopen(member_file_name, O_RDONLY, 0666); + VERIFY(fd >= 0, "HDopen() failed."); + + if(size_remaining >= FAMILY_SIZE ){ + bytes_to_read = FAMILY_SIZE; + size_remaining -= FAMILY_SIZE; + } else { + bytes_to_read = size_remaining; + size_remaining = 0; + } + + /* read the member file from disk into the buffer */ + bytes_read = HDread(fd, insertion_ptr, (size_t)bytes_to_read); + VERIFY(bytes_read == bytes_to_read, "HDread() failed."); + + insertion_ptr = (void *)(((char *)insertion_ptr) + bytes_to_read); + + i++; + + /* close the test file */ + result = HDclose(fd); + VERIFY(result == 0, "HDclose() failed."); + } + } else { + /* get the size of the test file */ + result = HDstat(file_name, &stat_buf); + VERIFY(result == 0, "HDstat() failed."); + + /* Since we use the eoa to calculate the image size, the file size + * may be larger. This is OK, as long as (in this specialized instance) + * the remainder of the file is all '\0's. + */ + file_size = (ssize_t)stat_buf.st_size; + + /* with latest mods to truncate call in core file drive, + * file size should match image size + */ + VERIFY(file_size == image_size, "file size != image size."); + + /* allocate a buffer for the test file image */ + file_image_ptr = HDmalloc((size_t)file_size); + VERIFY(file_image_ptr != NULL, "HDmalloc(2) failed."); + + /* open the test file using standard I/O calls */ + fd = HDopen(file_name, O_RDONLY, 0666); + VERIFY(fd >= 0, "HDopen() failed."); + + /* read the test file from disk into the buffer */ + bytes_read = HDread(fd, file_image_ptr, (size_t)file_size); + VERIFY(bytes_read == file_size, "HDread() failed."); + + /* close the test file */ + result = HDclose(fd); + VERIFY(result == 0, "HDclose() failed."); + } + + /* verify that the file and the image contain the same data */ + identical = TRUE; + i = 0; + while((i < (int)image_size) && identical) { + if(((char *)image_ptr)[i] != ((char *)file_image_ptr)[i]) + identical = FALSE; + i++; + } + VERIFY(identical, "file and image differ."); + + + /* finally, verify that we can use the core file driver to open the image */ + + /* create fapl for core file driver */ + core_fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VERIFY(core_fapl_id >=0, "H5Pcreate() failed"); + + /* setup core_fapl_id to use the core file driver */ + err = H5Pset_fapl_core(core_fapl_id, (size_t)(64 * 1024), FALSE); + VERIFY(err == SUCCEED, "H5Pset_fapl_core() failed."); + + /* Set file image in core fapl */ + err = H5Pset_file_image(core_fapl_id, image_ptr, (size_t)image_size); + VERIFY(err == SUCCEED, "H5Pset_file_image() failed."); + + /* open the file image with the core file driver */ + core_file_id = H5Fopen("nonesuch", H5F_ACC_RDWR, core_fapl_id); + VERIFY(core_file_id >= 0, "H5Fopen() of file image failed."); + + /* close the file image with the core file driver */ + err = H5Fclose(core_file_id); + VERIFY(err == SUCCEED, "H5Fclose(core_file_id) failed."); + + /* dicard core fapl */ + err = H5Pclose(core_fapl_id); + VERIFY(err == SUCCEED, "H5Pclose(core_fapl_id) failed."); + + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl); + VERIFY(result != 0, "h5_cleanup() failed."); + + /* discard the image buffer if it exists */ + if(image_ptr != NULL) + HDfree(image_ptr); + + /* discard the image buffer if it exists */ + if(file_image_ptr != NULL) + HDfree(file_image_ptr); + + PASSED(); + + return 0; + +error: + return 1; +} /* end test_get_file_image() */ + +/****************************************************************************** + * Function: test_get_file_image_error_rejection + * + * Purpose: Verify that H5Fget_file_image() rejects invalid input. + * + * Programmer: John Mainzer + * Tuesday, November 22, 2011 + * + ****************************************************************************** + */ + +#define TYPE_SLICE ((haddr_t)0x10000LL) + +static int +test_get_file_image_error_rejection(void) +{ + const char *memb_name[H5FD_MEM_NTYPES]; + char file_name[1024] = "\0"; + void * image_ptr = NULL; + int data[100]; + int i; + int result; + hid_t fapl_id = -1; + hid_t file_id = -1; + hid_t dset_id = -1; + hid_t space_id = -1; + herr_t err; + hsize_t dims[2]; + ssize_t bytes_read; + ssize_t image_size; + hid_t memb_fapl[H5FD_MEM_NTYPES]; + haddr_t memb_addr[H5FD_MEM_NTYPES]; + H5FD_mem_t mt; + H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; + + + TESTING("H5Fget_file_image() error rejection"); + + /************************ Sub-Test #1 ********************************/ + /* set up a test file, and try to get its image with a buffer that is + * too small. Call to H5Fget_file_image() should fail. + * + * Since we have already done the necessary setup, verify that + * H5Fget_file_image() will fail with: + * + * bad file id, or + * + * good id, but not a file id + */ + + + /* setup fapl -- driver type doesn't matter much, so make it stdio */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VERIFY(fapl_id >= 0, "H5Pcreate(1) failed"); + + err = H5Pset_fapl_stdio(fapl_id); + VERIFY(err >= 0, "H5Pset_fapl_stdio() failed"); + + /* setup the file name */ + h5_fixname(FILENAME2[6], fapl_id, file_name, sizeof(file_name)); + VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); + + /* create the file */ + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl_id); + VERIFY(file_id >= 0, "H5Fcreate() failed."); + + /* Set up data space for new new data set */ + dims[0] = 10; + dims[1] = 10; + space_id = H5Screate_simple(2, dims, dims); + VERIFY(space_id >= 0, "H5Screate() failed"); + + /* Create a dataset */ + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset_id >=0, "H5Dcreate() failed"); + + /* write some data to the data set */ + for (i = 0; i < 100; i++) + data[i] = i; + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)data); + VERIFY(err >= 0, "H5Dwrite() failed."); + + /* Flush the file */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VERIFY(err >= 0, "H5Fflush failed"); + + /* get the size of the file */ + image_size = H5Fget_file_image(file_id, NULL, (size_t)0); + VERIFY(image_size > 0, "H5Fget_file_image(1 -- test 1) failed."); + + /* allocate a buffer of the appropriate size */ + image_ptr = HDmalloc((size_t)image_size); + VERIFY(image_ptr != NULL, "HDmalloc(1) failed."); + + /* load the image of the file into the buffer */ + H5E_BEGIN_TRY { + bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)(image_size - 1)); + } H5E_END_TRY; + VERIFY(bytes_read < 0, "H5Fget_file_image(2 -- test 1) succeeded."); + + /* Call H5Fget_file_image() with good buffer and buffer size, + * but non-existant file_id. Should fail. + */ + H5E_BEGIN_TRY { + bytes_read = H5Fget_file_image((hid_t)0, image_ptr, (size_t)(image_size)); + } H5E_END_TRY; + VERIFY(bytes_read < 0, "H5Fget_file_image(3 -- test 1) succeeded."); + + /* Call H5Fget_file_image() with good buffer and buffer size, + * but a file_id of the wrong type. Should fail. + */ + H5E_BEGIN_TRY { + bytes_read = H5Fget_file_image(dset_id, image_ptr, (size_t)(image_size)); + } H5E_END_TRY; + VERIFY(bytes_read < 0, "H5Fget_file_image(4 -- test 1) succeeded."); + + /* Close dset and space */ + err = H5Dclose(dset_id); + VERIFY(err >= 0, "H5Dclose failed"); + err = H5Sclose(space_id); + VERIFY(err >= 0, "H5Sclose failed"); + + /* close the test file */ + err = H5Fclose(file_id); + VERIFY(err == SUCCEED, "H5Fclose(file_id) failed."); + + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_cleanup(1) failed."); + + /* discard the image buffer if it exists */ + if(image_ptr != NULL) + HDfree(image_ptr); + + /************************** Test #2 **********************************/ + /* set up a multi file driver test file, and try to get its image + * with H5Fget_file_image(). Attempt should fail. + */ + + /* setup parameters for multi file driver */ + for(mt = (H5FD_mem_t)0; mt < H5FD_MEM_NTYPES; mt = (H5FD_mem_t)(mt + 1)) { + memb_addr[mt] = HADDR_UNDEF; + memb_fapl[mt] = H5P_DEFAULT; + memb_map[mt] = H5FD_MEM_DRAW; + memb_name[mt] = NULL; + } + + memb_map[H5FD_MEM_SUPER] = H5FD_MEM_SUPER; + memb_fapl[H5FD_MEM_SUPER] = H5P_DEFAULT; + memb_name[H5FD_MEM_SUPER] = "%s-s.h5"; + memb_addr[H5FD_MEM_SUPER] = 0; + + memb_map[H5FD_MEM_BTREE] = H5FD_MEM_BTREE; + memb_fapl[H5FD_MEM_BTREE] = H5P_DEFAULT; + memb_name[H5FD_MEM_BTREE] = "%s-b.h5"; + memb_addr[H5FD_MEM_BTREE] = memb_addr[H5FD_MEM_SUPER] + TYPE_SLICE; + + memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW; + memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT; + memb_name[H5FD_MEM_DRAW] = "%s-r.h5"; + memb_addr[H5FD_MEM_DRAW] = memb_addr[H5FD_MEM_BTREE] + TYPE_SLICE; + + memb_map[H5FD_MEM_GHEAP] = H5FD_MEM_GHEAP; + memb_fapl[H5FD_MEM_GHEAP] = H5P_DEFAULT; + memb_name[H5FD_MEM_GHEAP] = "%s-g.h5"; + memb_addr[H5FD_MEM_GHEAP] = memb_addr[H5FD_MEM_DRAW] + TYPE_SLICE; + + memb_map[H5FD_MEM_LHEAP] = H5FD_MEM_LHEAP; + memb_fapl[H5FD_MEM_LHEAP] = H5P_DEFAULT; + memb_name[H5FD_MEM_LHEAP] = "%s-l.h5"; + memb_addr[H5FD_MEM_LHEAP] = memb_addr[H5FD_MEM_GHEAP] + TYPE_SLICE; + + memb_map[H5FD_MEM_OHDR] = H5FD_MEM_OHDR; + memb_fapl[H5FD_MEM_OHDR] = H5P_DEFAULT; + memb_name[H5FD_MEM_OHDR] = "%s-o.h5"; + memb_addr[H5FD_MEM_OHDR] = memb_addr[H5FD_MEM_LHEAP] + TYPE_SLICE; + + /* setup fapl */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VERIFY(fapl_id >= 0, "H5Pcreate(2) failed"); + + /* setup the fapl for the multi file driver */ + err = H5Pset_fapl_multi(fapl_id, memb_map, memb_fapl, memb_name, + memb_addr, FALSE); + VERIFY(err >= 0, "H5Pset_fapl_multi failed"); + + /* setup the file name */ + h5_fixname(FILENAME2[4], fapl_id, file_name, sizeof(file_name)); + VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); + + /* create the file */ + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl_id); + VERIFY(file_id >= 0, "H5Fcreate() failed."); + + /* Set up data space for new new data set */ + dims[0] = 10; + dims[1] = 10; + space_id = H5Screate_simple(2, dims, dims); + VERIFY(space_id >= 0, "H5Screate() failed"); + + /* Create a dataset */ + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset_id >=0, "H5Dcreate() failed"); + + /* write some data to the data set */ + for (i = 0; i < 100; i++) + data[i] = i; + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)data); + VERIFY(err >= 0, "H5Dwrite() failed."); + + /* Flush the file */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VERIFY(err >= 0, "H5Fflush failed"); + + /* attempt to get the size of the file -- should fail */ + H5E_BEGIN_TRY { + image_size = H5Fget_file_image(file_id, NULL, (size_t)0); + } H5E_END_TRY; + VERIFY(image_size == -1, "H5Fget_file_image(5) succeeded."); + + /* Close dset and space */ + err = H5Dclose(dset_id); + VERIFY(err >= 0, "H5Dclose failed"); + err = H5Sclose(space_id); + VERIFY(err >= 0, "H5Sclose failed"); + + /* close the test file */ + err = H5Fclose(file_id); + VERIFY(err == SUCCEED, "H5Fclose(2) failed."); + + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_cleanup(2 failed."); + + /************************** Test #3 **********************************/ + /* set up a split file driver test file, and try to get its image + * with H5Fget_file_image(). Attempt should fail. + */ + + /* create fapl */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); + + /* setup the fapl for the split file driver */ + err = H5Pset_fapl_split(fapl_id, "-m.h5", H5P_DEFAULT, "-r.h5", H5P_DEFAULT); + VERIFY(err >= 0, "H5Pset_fapl_split failed"); + + /* setup the file name */ + h5_fixname(FILENAME2[5], fapl_id, file_name, sizeof(file_name)); + VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); + + /* create the file */ + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl_id); + VERIFY(file_id >= 0, "H5Fcreate() failed."); + + /* Set up data space for new new data set */ + dims[0] = 10; + dims[1] = 10; + space_id = H5Screate_simple(2, dims, dims); + VERIFY(space_id >= 0, "H5Screate() failed"); + + /* Create a dataset */ + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset_id >=0, "H5Dcreate() failed"); + + /* write some data to the data set */ + for (i = 0; i < 100; i++) + data[i] = i; + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)data); + VERIFY(err >= 0, "H5Dwrite() failed."); + + /* Flush the file */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VERIFY(err >= 0, "H5Fflush failed"); + + /* attempt to get the size of the file -- should fail */ + H5E_BEGIN_TRY { + image_size = H5Fget_file_image(file_id, NULL, (size_t)0); + } H5E_END_TRY; + VERIFY(image_size == -1, "H5Fget_file_image(6) succeeded."); + + /* Close dset and space */ + err = H5Dclose(dset_id); + VERIFY(err >= 0, "H5Dclose failed"); + err = H5Sclose(space_id); + VERIFY(err >= 0, "H5Sclose failed"); + + /* close the test file */ + err = H5Fclose(file_id); + VERIFY(err == SUCCEED, "H5Fclose(2) failed."); + + + /************************** Test #4 **********************************/ + /* set up a family file driver test file, and try to get its image + * with H5Fget_file_image(). Attempt should fail. + */ + + /* create fapl */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VERIFY(fapl_id >= 0, "H5Pcreate(3) failed"); + + err = H5Pset_fapl_family(fapl_id, (hsize_t)FAMILY_SIZE, H5P_DEFAULT); + VERIFY(err >= 0, "H5Pset_fapl_family failed"); + + h5_fixname(FILENAME2[3], fapl_id, file_name, sizeof(file_name)); + VERIFY(HDstrlen(file_name)>0, "h5_fixname failed"); + + /* create the file */ + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl_id); + VERIFY(file_id >= 0, "H5Fcreate() failed."); + + /* Set up data space for new new data set */ + dims[0] = 10; + dims[1] = 10; + space_id = H5Screate_simple(2, dims, dims); + VERIFY(space_id >= 0, "H5Screate() failed"); + + /* Create a dataset */ + dset_id = H5Dcreate2(file_id, "dset 0", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VERIFY(dset_id >=0, "H5Dcreate() failed"); + + /* write some data to the data set */ + for (i = 0; i < 100; i++) + data[i] = i; + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)data); + VERIFY(err >= 0, "H5Dwrite() failed."); + + /* Flush the file */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VERIFY(err >= 0, "H5Fflush failed"); + + /* attempt to get the size of the file -- should fail */ + H5E_BEGIN_TRY { + image_size = H5Fget_file_image(file_id, NULL, (size_t)0); + } H5E_END_TRY; + VERIFY(image_size == -1, "H5Fget_file_image(7) succeeded."); + + /* Close dset and space */ + err = H5Dclose(dset_id); + VERIFY(err >= 0, "H5Dclose failed"); + err = H5Sclose(space_id); + VERIFY(err >= 0, "H5Sclose failed"); + + /* close the test file */ + err = H5Fclose(file_id); + VERIFY(err == SUCCEED, "H5Fclose(2) failed."); + + /* tidy up */ + result = h5_cleanup(FILENAME2, fapl_id); + VERIFY(result != 0, "h5_cleanup(2 failed."); + + PASSED(); + + return 0; + +error: + return 1; +} + +int +main(void) +{ + int errors = 0; + hid_t fapl; + + h5_reset(); + + printf("Testing File Image Functionality.\n"); + + errors += test_properties(); + errors += test_callbacks(); + errors += test_core(); + + /* test H5Fget_file_image() with sec2 driver */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + if(0 > H5Pset_fapl_sec2(fapl)) + errors++; + else + errors += test_get_file_image("H5Fget_file_image() with sec2 driver", + 0, fapl); + + /* test H5Fget_file_image() with stdio driver */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + if(0 > H5Pset_fapl_stdio(fapl)) + errors++; + else + errors += test_get_file_image("H5Fget_file_image() with stdio driver", + 1, fapl); + + /* test H5Fget_file_image() with core driver */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + if(0 > H5Pset_fapl_core(fapl, (size_t)(64 *1024), TRUE)) + errors++; + else + errors += test_get_file_image("H5Fget_file_image() with core driver", + 2, fapl); + +#if 0 + /* at present, H5Fget_file_image() rejects files opened with the + * family file driver, due to the addition of a driver info message + * in the super block. This message prevents the image being opened + * with any driver other than the family file driver, which sort of + * defeats the purpose of the get file image operation. + * + * While this issues is quite fixable, we don't have time or resources + * for this right now. Once we do, the following code should be + * suitable for testing the fix. + */ + /* test H5Fget_file_image() with family file driver */ + fapl = H5Pcreate(H5P_FILE_ACCESS); + if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_SIZE, H5P_DEFAULT) < 0) + errors++; + else + errors += test_get_file_image("H5Fget_file_image() with family driver", + 3, fapl); +#endif + + errors += test_get_file_image_error_rejection(); + + + if(errors) { + printf("***** %d File Image TEST%s FAILED! *****\n", + errors, errors > 1 ? "S" : ""); + return 1; + } + + printf("All File Image tests passed.\n"); + return 0; +} + diff --git a/test/file_image_core_test.h5 b/test/file_image_core_test.h5 new file mode 100644 index 0000000..1cc5130 Binary files /dev/null and b/test/file_image_core_test.h5 differ diff --git a/test/gen_file_image.c b/test/gen_file_image.c new file mode 100644 index 0000000..bc9de29 --- /dev/null +++ b/test/gen_file_image.c @@ -0,0 +1,91 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Quincey Koziol + * Friday, March 30, 2012 + * + * Purpose: Create a simple file for use with the file image tests. + * + */ +#include "hdf5.h" + +#define TESTFILE "file_image_core_test.h5" + +/* 2-D dataset with fixed dimensions */ +#define SPACE_RANK 2 +#define SPACE_DIM1 128 +#define SPACE_DIM2 32 + +/* Dataset data */ +int data[SPACE_DIM1][SPACE_DIM2]; + + +/*------------------------------------------------------------------------- + * Function: main + * + * Purpose: + * + * Return: Success: + * + * Failure: + * + * Programmer: Quincey Koziol + * Friday, March 30, 2012 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + hid_t file, space, dset; + hsize_t dims[SPACE_RANK] = {SPACE_DIM1, SPACE_DIM2}; + size_t i, j; /* Local index variables */ + + /* Initialize the data */ + for(i = 0; i < SPACE_DIM1; i++) + for(j = 0; j < SPACE_DIM2; j++) + data[i][j] = (int)(j % 5); + + /* Create the file */ + file = H5Fcreate(TESTFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + if(file < 0) + printf("file < 0!\n"); + + /* Create the dataspace */ + space = H5Screate_simple(SPACE_RANK, dims, NULL); + if(space < 0) + printf("space < 0!\n"); + + /* Create the compressed dataset */ + dset = H5Dcreate2(file, "Dataset1", H5T_NATIVE_INT, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + if(dset < 0) + printf("dset < 0!\n"); + + /* Write the data to the dataset */ + if(H5Dwrite(dset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data) < 0) + printf("H5Dwrite() failed!\n"); + + /* Close everything */ + if(H5Dclose(dset) < 0) + printf("H5Dclose() failed!\n"); + if(H5Sclose(space) < 0) + printf("H5Sclose() failed!\n"); + if(H5Fclose(file) < 0) + printf("H5Fclose() failed!\n"); + + return 0; +} + diff --git a/testpar/Makefile.am b/testpar/Makefile.am index 5a7a3f3..b2fb97c 100644 --- a/testpar/Makefile.am +++ b/testpar/Makefile.am @@ -31,8 +31,8 @@ TEST_SCRIPT_PARA=testph5.sh check_PROGRAMS = $(TEST_PROG_PARA) check_SCRIPTS= $(TEST_SCRIPT) -testphdf5_SOURCES=testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c \ - t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c +testphdf5_SOURCES=testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ + t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c # The tests all depend on the hdf5 library and the test library LDADD = $(LIBH5TEST) $(LIBHDF5) diff --git a/testpar/Makefile.in b/testpar/Makefile.in index ae0c7d0..a9a4135 100644 --- a/testpar/Makefile.in +++ b/testpar/Makefile.in @@ -95,9 +95,10 @@ t_shapesame_OBJECTS = t_shapesame.$(OBJEXT) t_shapesame_LDADD = $(LDADD) t_shapesame_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) am_testphdf5_OBJECTS = testphdf5.$(OBJEXT) t_dset.$(OBJEXT) \ - t_file.$(OBJEXT) t_mdset.$(OBJEXT) t_ph5basic.$(OBJEXT) \ - t_coll_chunk.$(OBJEXT) t_span_tree.$(OBJEXT) \ - t_chunk_alloc.$(OBJEXT) t_filter_read.$(OBJEXT) + t_file.$(OBJEXT) t_file_image.$(OBJEXT) t_mdset.$(OBJEXT) \ + t_ph5basic.$(OBJEXT) t_coll_chunk.$(OBJEXT) \ + t_span_tree.$(OBJEXT) t_chunk_alloc.$(OBJEXT) \ + t_filter_read.$(OBJEXT) testphdf5_OBJECTS = $(am_testphdf5_OBJECTS) testphdf5_LDADD = $(LDADD) testphdf5_DEPENDENCIES = $(LIBH5TEST) $(LIBHDF5) @@ -431,8 +432,8 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/test TEST_PROG_PARA = t_mpi t_posix_compliant testphdf5 t_cache t_pflush1 t_pflush2 t_shapesame TEST_SCRIPT_PARA = testph5.sh check_SCRIPTS = $(TEST_SCRIPT) -testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c \ - t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c +testphdf5_SOURCES = testphdf5.c t_dset.c t_file.c t_file_image.c t_mdset.c \ + t_ph5basic.c t_coll_chunk.c t_span_tree.c t_chunk_alloc.c t_filter_read.c # The tests all depend on the hdf5 library and the test library @@ -532,6 +533,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_coll_chunk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_dset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_filter_read.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mdset.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t_mpi.Po@am__quote@ diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c new file mode 100644 index 0000000..d265957 --- /dev/null +++ b/testpar/t_file_image.c @@ -0,0 +1,395 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Parallel tests for file image operations + */ + +#include "testphdf5.h" + +/* file_image_daisy_chain_test + * + * Process zero: + * + * 1) Creates a core file with an integer vector data set of + * length n (= mpi_size), + * + * 2) Initializes the vector to zero in * location 0, and to -1 + * everywhere else. + * + * 3) Flushes the core file, and gets an image of it. Closes + * the core file. + * + * 4) Sends the image to process 1. + * + * 5) Awaits receipt on a file image from process n-1. + * + * 6) opens the image received from process n-1, verifies that + * it contains a vector of length equal to mpi_size, and + * that the vector contains (0, 1, 2, ... n-1) + * + * 7) closes the core file and exits. + * + * Process i (0 < i < n) + * + * 1) Await receipt of file image from process (i - 1). + * + * 2) Open the image with the core file driver, verify that i + * contains a vector v of length, and that v[j] = j for + * 0 <= j < i, and that v[j] == -1 for i <= j < n + * + * 3) Set v[i] = i in the core file. + * + * 4) Flush the core file and send it to process (i + 1) % n. + * + * 5) close the core file and exit. + * + * Test fails on a hang (if an image is not received), or on invalid data. + * + * JRM -- 11/28/11 + */ +void +file_image_daisy_chain_test(void) +{ + char file_name[1024] = "\0"; + int mpi_size, mpi_rank; + int mpi_result; + int i; + int space_ndims; + MPI_Status rcvstat; + int * vector_ptr = NULL; + hid_t fapl_id = -1; + hid_t file_id; /* file IDs */ + hid_t dset_id = -1; + hid_t dset_type_id = -1; + hid_t space_id = -1; + herr_t err; + hsize_t dims[1]; + void * image_ptr = NULL; + ssize_t bytes_read; + ssize_t image_len; + hbool_t vector_ok = TRUE; + htri_t tri_result; + + + /* set up MPI parameters */ + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + /* setup file name */ + HDsnprintf(file_name, 1024, "file_image_daisy_chain_test_%05d.h5", + (int)mpi_rank); + + if(mpi_rank == 0) { + + /* 1) Creates a core file with an integer vector data set + * of length mpi_size, + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl_id >= 0), "creating fapl"); + + err = H5Pset_fapl_core(fapl_id, (size_t)(64 *1024), FALSE); + VRFY((err >= 0), "setting core file driver in fapl."); + + file_id = H5Fcreate(file_name, 0, H5P_DEFAULT, fapl_id); + VRFY((file_id >= 0), "created core file"); + + dims[0] = (hsize_t)mpi_size; + space_id = H5Screate_simple(1, dims, dims); + VRFY((space_id >= 0), "created data space"); + + dset_id = H5Dcreate2(file_id, "v", H5T_NATIVE_INT, space_id, + H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + VRFY((dset_id >= 0), "created data set"); + + + /* 2) Initialize the vector to zero in location 0, and + * to -1 everywhere else. + */ + + vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + VRFY((vector_ptr != NULL), "allocated in memory representation of vector"); + + vector_ptr[0] = 0; + for(i = 1; i < mpi_size; i++) + vector_ptr[i] = -1; + + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)vector_ptr); + VRFY((err >= 0), "wrote initial data to vector."); + + HDfree(vector_ptr); + vector_ptr = NULL; + + + /* 3) Flush the core file, and get an image of it. Close + * the core file. + */ + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VRFY((err >= 0), "flushed core file."); + + image_len = H5Fget_file_image(file_id, NULL, (size_t)0); + VRFY((image_len > 0), "got image file size"); + + image_ptr = (void *)HDmalloc((size_t)image_len); + VRFY(image_ptr != NULL, "allocated file image buffer."); + + bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); + VRFY(bytes_read == image_len, "wrote file into image buffer"); + + err = H5Sclose(space_id); + VRFY((err >= 0), "closed data space."); + + err = H5Dclose(dset_id); + VRFY((err >= 0), "closed data set."); + + err = H5Fclose(file_id); + VRFY((err >= 0), "closed core file(1)."); + + err = H5Pclose(fapl_id); + VRFY((err >= 0), "closed fapl(1)."); + + + /* 4) Send the image to process 1. */ + + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, 1, 0, MPI_COMM_WORLD); + VRFY((mpi_result == MPI_SUCCESS), "sent image size to process 1"); + + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + MPI_BYTE, 1, 0, MPI_COMM_WORLD); + VRFY((mpi_result == MPI_SUCCESS), "sent image to process 1"); + + HDfree(image_ptr); + image_ptr = NULL; + image_len = 0; + + + /* 5) Await receipt on a file image from process n-1. */ + + mpi_result = MPI_Recv((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, mpi_size - 1, 0, MPI_COMM_WORLD, + &rcvstat); + VRFY((mpi_result == MPI_SUCCESS), "received image len from process n-1"); + + image_ptr = (void *)HDmalloc((size_t)image_len); + VRFY(image_ptr != NULL, "allocated file image receive buffer."); + + mpi_result = MPI_Recv((void *)image_ptr, (int)image_len, + MPI_BYTE, mpi_size - 1, 0, MPI_COMM_WORLD, + &rcvstat); + VRFY((mpi_result == MPI_SUCCESS), \ + "received file image from process n-1"); + + /* 6) open the image received from process n-1, verify that + * it contains a vector of length equal to mpi_size, and + * that the vector contains (0, 1, 2, ... n-1). + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl_id >= 0), "creating fapl"); + + err = H5Pset_fapl_core(fapl_id, (size_t)(64 *1024), FALSE); + VRFY((err >= 0), "setting core file driver in fapl."); + + err = H5Pset_file_image(fapl_id, image_ptr, (size_t)image_len); + VRFY((err >= 0), "set file image in fapl."); + + file_id = H5Fopen(file_name, H5F_ACC_RDWR, fapl_id); + VRFY((file_id >= 0), "opened received file image file"); + + dset_id = H5Dopen1(file_id, "v"); + VRFY((dset_id >= 0), "opened data set"); + + dset_type_id = H5Dget_type(dset_id); + VRFY((dset_type_id >= 0), "obtained data set type"); + + tri_result = H5Tequal(dset_type_id, H5T_NATIVE_INT); + VRFY((tri_result == TRUE), "verified data set type"); + + space_id = H5Dget_space(dset_id); + VRFY((space_id >= 0), "opened data space"); + + space_ndims = H5Sget_simple_extent_ndims(space_id); + VRFY((space_ndims == 1), "verified data space num dims(1)"); + + space_ndims = H5Sget_simple_extent_dims(space_id, dims, NULL); + VRFY((space_ndims == 1), "verified data space num dims(2)"); + VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); + + vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); + + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)vector_ptr); + VRFY((err >= 0), "read received vector."); + + vector_ok = TRUE; + for(i = 0; i < mpi_size; i++) + if(vector_ptr[i] != i) + vector_ok = FALSE; + VRFY((vector_ok), "verified received vector."); + + /* 7) closes the core file and exit. */ + + err = H5Sclose(space_id); + VRFY((err >= 0), "closed data space."); + + err = H5Dclose(dset_id); + VRFY((err >= 0), "closed data set."); + + err = H5Fclose(file_id); + VRFY((err >= 0), "closed core file(1)."); + + err = H5Pclose(fapl_id); + VRFY((err >= 0), "closed fapl(1)."); + + HDfree(image_ptr); + image_ptr = NULL; + image_len = 0; + } else { + /* 1) Await receipt of file image from process (i - 1). */ + + mpi_result = MPI_Recv((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, mpi_rank - 1, 0, MPI_COMM_WORLD, + &rcvstat); + VRFY((mpi_result == MPI_SUCCESS), \ + "received image size from process mpi_rank-1"); + + image_ptr = (void *)HDmalloc((size_t)image_len); + VRFY(image_ptr != NULL, "allocated file image receive buffer."); + + mpi_result = MPI_Recv((void *)image_ptr, (int)image_len, + MPI_BYTE, mpi_rank - 1, 0, MPI_COMM_WORLD, + &rcvstat); + VRFY((mpi_result == MPI_SUCCESS), \ + "received file image from process mpi_rank-1"); + + /* 2) Open the image with the core file driver, verify that it + * contains a vector v of length, and that v[j] = j for + * 0 <= j < i, and that v[j] == -1 for i <= j < n + */ + fapl_id = H5Pcreate(H5P_FILE_ACCESS); + VRFY((fapl_id >= 0), "creating fapl"); + + err = H5Pset_fapl_core(fapl_id, (size_t)(64 * 1024), FALSE); + VRFY((err >= 0), "setting core file driver in fapl."); + + err = H5Pset_file_image(fapl_id, image_ptr, (size_t)image_len); + VRFY((err >= 0), "set file image in fapl."); + + file_id = H5Fopen(file_name, H5F_ACC_RDWR, fapl_id); + H5Eprint1(stderr); + VRFY((file_id >= 0), "opened received file image file"); + + dset_id = H5Dopen1(file_id, "v"); + VRFY((dset_id >= 0), "opened data set"); + + dset_type_id = H5Dget_type(dset_id); + VRFY((dset_type_id >= 0), "obtained data set type"); + + tri_result = H5Tequal(dset_type_id, H5T_NATIVE_INT); + VRFY((tri_result == TRUE), "verified data set type"); + + space_id = H5Dget_space(dset_id); + VRFY((space_id >= 0), "opened data space"); + + space_ndims = H5Sget_simple_extent_ndims(space_id); + VRFY((space_ndims == 1), "verified data space num dims(1)"); + + space_ndims = H5Sget_simple_extent_dims(space_id, dims, NULL); + VRFY((space_ndims == 1), "verified data space num dims(2)"); + VRFY((dims[0] == (hsize_t)mpi_size), "verified data space dims"); + + vector_ptr = (int *)HDmalloc((size_t)(mpi_size) * sizeof(int)); + VRFY((vector_ptr != NULL), "allocated in memory rep of vector"); + + err = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)vector_ptr); + VRFY((err >= 0), "read received vector."); + + vector_ok = TRUE; + for(i = 0; i < mpi_size; i++){ + if(i < mpi_rank) { + if(vector_ptr[i] != i) + vector_ok = FALSE; + } else { + if(vector_ptr[i] != -1) + vector_ok = FALSE; + } + } + VRFY((vector_ok), "verified received vector."); + + + /* 3) Set v[i] = i in the core file. */ + + vector_ptr[mpi_rank] = mpi_rank; + + err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, + H5P_DEFAULT, (void *)vector_ptr); + VRFY((err >= 0), "wrote modified data to vector."); + + HDfree(vector_ptr); + vector_ptr = NULL; + + + /* 4) Flush the core file and send it to process (mpi_rank + 1) % n. */ + + err = H5Fflush(file_id, H5F_SCOPE_GLOBAL); + VRFY((err >= 0), "flushed core file."); + + image_len = H5Fget_file_image(file_id, NULL, (size_t)0); + VRFY((image_len > 0), "got (possibly modified) image file len"); + + image_ptr = (void *)HDrealloc((void *)image_ptr, (size_t)image_len); + VRFY(image_ptr != NULL, "re-allocated file image buffer."); + + bytes_read = H5Fget_file_image(file_id, image_ptr, (size_t)image_len); + VRFY(bytes_read == image_len, "wrote file into image buffer"); + + mpi_result = MPI_Ssend((void *)(&image_len), (int)sizeof(ssize_t), + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + MPI_COMM_WORLD); + VRFY((mpi_result == MPI_SUCCESS), \ + "sent image size to process (mpi_rank + 1) % mpi_size"); + + mpi_result = MPI_Ssend((void *)image_ptr, (int)image_len, + MPI_BYTE, (mpi_rank + 1) % mpi_size, 0, + MPI_COMM_WORLD); + VRFY((mpi_result == MPI_SUCCESS), \ + "sent image to process (mpi_rank + 1) % mpi_size"); + + HDfree(image_ptr); + image_ptr = NULL; + image_len = 0; + + /* 5) close the core file and exit. */ + + err = H5Sclose(space_id); + VRFY((err >= 0), "closed data space."); + + err = H5Dclose(dset_id); + VRFY((err >= 0), "closed data set."); + + err = H5Fclose(file_id); + VRFY((err >= 0), "closed core file(1)."); + + err = H5Pclose(fapl_id); + VRFY((err >= 0), "closed fapl(1)."); + } + + return; + +} /* file_image_daisy_chain_test() */ + diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 4ec05ca..3a86642 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -502,6 +502,13 @@ int main(int argc, char **argv) "test actual io mode proprerty", PARATESTFILE); + if((mpi_size < 2) && MAINPROCESS) { + printf("File Image Ops daisy chain test needs at least 2 processes.\n"); + printf("File Image Ops daisy chain test will be skipped \n"); + } + AddTest((mpi_size < 2)? "-fiodc" : "fiodc", file_image_daisy_chain_test, NULL, + "file image ops daisy chain", NULL); + /* Display testing information */ TestInfo(argv[0]); diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 15ef75f..da11c62 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -269,6 +269,7 @@ void lower_dim_size_comp_test(void); void link_chunk_collective_io_test(void); void contig_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type); void checker_board_hyperslab_dr_pio_test(ShapeSameTestMethods sstest_type); +void file_image_daisy_chain_test(void); #ifdef H5_HAVE_FILTER_DEFLATE void compress_readAll(void); #endif /* H5_HAVE_FILTER_DEFLATE */ -- cgit v0.12 From 8123f8221a0ba358d8a371c3ce43f2a1f931b55a Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Sat, 31 Mar 2012 15:50:31 -0500 Subject: [svn-r22220] Feature: HDFFV-7981 Added test to verify h5repack --metadata option produces bigger size file. Tested: h5committest (koala, jam, ostrich). --- tools/h5repack/h5repacktst.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 5d72ce4..5c6f87b 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -171,6 +171,8 @@ int main (void) diff_opt_t diff_options; hsize_t fs_size = 0; /* free space section threshold */ H5F_file_space_type_t fs_type = H5F_FILE_SPACE_DEFAULT; /* file space handling strategy */ + h5_stat_t file_stat; + h5_stat_size_t fsize1, fsize2; /* file sizes */ #if defined (H5_HAVE_FILTER_SZIP) int szip_can_encode = 0; #endif @@ -1561,18 +1563,36 @@ int main (void) /*------------------------------------------------------------------------- * test --metadata_block_size option + * Also verify that output file using the metadata_block_size option is + * larger than the output file one not using it. *------------------------------------------------------------------------- */ TESTING(" metadata block size option"); if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) GOERROR; + /* First run without metadata option. No need to verify the correctness */ + /* since this has been verified by earlier tests. Just record the file */ + /* size of the output file. */ + if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) + GOERROR; + if (HDstat(FNAME1OUT, &file_stat) < 0) + GOERROR; + fsize1 = file_stat.st_size; + /* run it again with metadata option */ pack_options.meta_block_size = 8192; if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; if(h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; + /* record the file size of the output file */ + if (HDstat(FNAME1OUT, &file_stat) < 0) + GOERROR; + fsize2 = file_stat.st_size; if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) GOERROR; + /* verify second file size is larger than the first one */ + if(fsize2 <= fsize1) + GOERROR; if(h5repack_end(&pack_options) < 0) GOERROR; PASSED(); -- cgit v0.12 From cb28551c3e3761347a371f9c55f1cde2a892b874 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2012 14:25:41 -0500 Subject: [svn-r22221] Description: Small code cleanup while tracking down h5repack issue. Tested on: Mac OSX/64 10.7.3 (amazon) w/debug (h5committest coming up) --- tools/h5repack/h5repacktst.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 5c6f87b..fe8f847 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1575,7 +1575,7 @@ int main (void) /* size of the output file. */ if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) GOERROR; - if (HDstat(FNAME1OUT, &file_stat) < 0) + if(HDstat(FNAME1OUT, &file_stat) < 0) GOERROR; fsize1 = file_stat.st_size; /* run it again with metadata option */ @@ -1584,12 +1584,12 @@ int main (void) GOERROR; if(h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) GOERROR; + if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) + GOERROR; /* record the file size of the output file */ - if (HDstat(FNAME1OUT, &file_stat) < 0) + if(HDstat(FNAME1OUT, &file_stat) < 0) GOERROR; fsize2 = file_stat.st_size; - if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) - GOERROR; /* verify second file size is larger than the first one */ if(fsize2 <= fsize1) GOERROR; -- cgit v0.12 From 6783ce354ca8910a160beccb2aa56e15cc81fc60 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2012 15:42:21 -0500 Subject: [svn-r22222] Description: Update GCC compiler flags for new 4.7.0 release. Tested on: Mac OSX/64 10.7.3 (amazon) w/gcc 4.7.0 --- config/gnu-flags | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) diff --git a/config/gnu-flags b/config/gnu-flags index 38ea4e4..40aa1da 100644 --- a/config/gnu-flags +++ b/config/gnu-flags @@ -186,10 +186,84 @@ esac # the information from the previous version and adding modifications to that. case "$cc_vendor-$cc_version" in +# Closer to the gcc 4.8 release, we should check for additional flags to +# include and break it out into it's own section, like the other versions +# below. -QAK + gcc-4.[78]*) + # Replace -ansi flag with -std=c99 flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" + + # Append warning flags + # Don't use the '-Wtraditional' flag, we're way past having K&R C code + # H5_CFLAGS="$H5_CFLAGS -Wtraditional" + # Don't use the '-Wtraditional-conversion' flag, there's too many warnings + # from GCC's assert macro + # H5_CFLAGS="$H5_CFLAGS -Wtraditional-conversion" + + # Append warning flags from gcc-3* case + # (don't use -Wpadded flag for normal builds, many of the warnings its + # issuing can't be fixed and they are making it hard to detect other, + # more important warnings) + #H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute -Wpadded" + H5_CFLAGS="$H5_CFLAGS -Wfloat-equal -Wmissing-format-attribute" + + # Append warning flags from gcc-3.2* case + H5_CFLAGS="$H5_CFLAGS -Wmissing-noreturn -Wpacked -Wdisabled-optimization" + + # Enable more format checking flags, beyond the basic -Wformat included + # in -Wall + H5_CFLAGS="$H5_CFLAGS -Wformat=2" + + # The "unreachable code" warning appears to be reliable now... + # (this warning was removed in gcc 4.5+) + #H5_CFLAGS="$H5_CFLAGS -Wunreachable-code" + + # Append warning flags from gcc-3.3* case + H5_CFLAGS="$H5_CFLAGS -Wendif-labels" + + # Append warning flags from gcc-3.4* case + H5_CFLAGS="$H5_CFLAGS -Wdeclaration-after-statement -Wold-style-definition -Winvalid-pch" + + # Replace old -W flag with new -Wextra flag + H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-W\ /-Wextra\ /g'`" + + # Append more extra warning flags that only gcc4.0+ know about + H5_CFLAGS="$H5_CFLAGS -Wvariadic-macros -Winit-self -Wmissing-include-dirs -Wswitch-default -Wswitch-enum -Wunused-macros" + + # Append more extra warning flags that only gcc 4.1+ know about + H5_CFLAGS="$H5_CFLAGS -Wunsafe-loop-optimizations -Wc++-compat" + + # Append more extra warning flags that only gcc 4.2+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow" + + # Append more extra warning flags that only gcc 4.3+ know about + # + # Technically, variable-length arrays are part of the C99 standard, but + # we should approach them a bit cautiously... -QAK + H5_CFLAGS="$H5_CFLAGS -Wlogical-op -Wlarger-than=2048 -Wvla" + + # Append more extra warning flags that only gcc 4.4+ know about + H5_CFLAGS="$H5_CFLAGS -Wsync-nand -Wframe-larger-than=16384 -Wpacked-bitfield-compat" + + # Append more extra warning flags that only gcc 4.5+ know about + H5_CFLAGS="$H5_CFLAGS -Wstrict-overflow=5 -Wjump-misses-init -Wunsuffixed-float-constants" + + # Append more extra warning flags that only gcc 4.6+ know about + H5_CFLAGS="$H5_CFLAGS -Wdouble-promotion -Wsuggest-attribute=const -Wtrampolines" + + # Append more extra warning flags that only gcc 4.7+ know about + H5_CFLAGS="$H5_CFLAGS -Wstack-usage=8192 -Wvector-operation-performance" + + # Try out the new "stack protector" feature in gcc 4.1 + # (Strictly speaking this isn't really a "warning" flag, so it's added to + # the debugging flags) + #DEBUG_CFLAGS="$DEBUG_CFLAGS -Wstack-protector -fstack-protector-all" + ;; + # Closer to the gcc 4.7 release, we should check for additional flags to # include and break it out into it's own section, like the other versions # below. -QAK - gcc-4.[67]*) + gcc-4.6*) # Replace -ansi flag with -std=c99 flag H5_CFLAGS="`echo $H5_CFLAGS | sed -e 's/-ansi/-std=c99/g'`" -- cgit v0.12 From 85594d2856141652ddca2261986ad2d53eee3cf2 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2012 16:18:37 -0500 Subject: [svn-r22224] Description: Clean up a few warnings and use constant values for free-space parameters for the metadata block size test. Tested on: Linux/64 2.6.18 (koala) w/production & szip (h5committested also) --- tools/h5repack/h5repack_copy.c | 4 ++-- tools/h5repack/h5repacktst.c | 29 +++++++++++++++++------------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 15df639..d38a15c 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -42,7 +42,7 @@ int _err_num = 0; \ char _msg[80]; \ H5Ewalk2(H5E_DEFAULT, H5E_WALK_DOWNWARD, walk_error_callback, &_err_num); \ - H5Eget_msg(_err_num, NULL, _msg, 80); \ + H5Eget_msg(_err_num, NULL, _msg, (size_t)80); \ error_msg("%s %s -- %s\n", #_fun, "failed", _msg); \ goto error; \ } \ @@ -311,7 +311,7 @@ int copy_objects(const char* fnamein, * set metadata block size option *------------------------------------------------------------------------- */ - if ( options->meta_block_size > 0 ) + if ( options->meta_block_size > 0 ) { /* either use the FAPL already created or create a new one */ if (fapl == H5P_DEFAULT) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index fe8f847..ae272ab 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1568,26 +1568,31 @@ int main (void) *------------------------------------------------------------------------- */ TESTING(" metadata block size option"); - if (h5repack_init (&pack_options, 0, fs_type, fs_size) < 0) - GOERROR; /* First run without metadata option. No need to verify the correctness */ /* since this has been verified by earlier tests. Just record the file */ /* size of the output file. */ - if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) + if(h5repack_init(&pack_options, 0, H5F_FILE_SPACE_DEFAULT, (hsize_t)0) < 0) GOERROR; - if(HDstat(FNAME1OUT, &file_stat) < 0) + if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) + GOERROR; + if(HDstat(FNAME4OUT, &file_stat) < 0) GOERROR; fsize1 = file_stat.st_size; + if(h5repack_end(&pack_options) < 0) + GOERROR; + /* run it again with metadata option */ + if(h5repack_init(&pack_options, 0, H5F_FILE_SPACE_DEFAULT, (hsize_t)0) < 0) + GOERROR; pack_options.meta_block_size = 8192; - if(h5repack(FNAME1, FNAME1OUT, &pack_options) < 0) + if(h5repack(FNAME4, FNAME4OUT, &pack_options) < 0) GOERROR; - if(h5diff(FNAME1, FNAME1OUT, NULL, NULL, &diff_options) > 0) + if(h5diff(FNAME4, FNAME4OUT, NULL, NULL, &diff_options) > 0) GOERROR; - if(h5repack_verify(FNAME1, FNAME1OUT, &pack_options) <= 0) + if(h5repack_verify(FNAME4, FNAME4OUT, &pack_options) <= 0) GOERROR; /* record the file size of the output file */ - if(HDstat(FNAME1OUT, &file_stat) < 0) + if(HDstat(FNAME4OUT, &file_stat) < 0) GOERROR; fsize2 = file_stat.st_size; /* verify second file size is larger than the first one */ @@ -5857,7 +5862,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) } /* select elements space for reference */ - status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, 3, coords_regrefed_dset[0]); + status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6179,7 +6184,7 @@ static herr_t gen_region_ref(hid_t loc_id) } /* select elements space for reference */ - status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6546,7 +6551,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* * create the region reference */ - status = H5Sselect_elements (objsid, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); @@ -6657,7 +6662,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) /* * create region reference */ - status = H5Sselect_elements(objsid, H5S_SELECT_SET, 4, coords[0]); + status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); -- cgit v0.12 From 982f1ff8ff1687cc62e310c991c0d56929b271fd Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2012 17:32:04 -0500 Subject: [svn-r22229] Description: Add 'H5O_mcdt_search_cb_t' to bin/trace script and re-run the bin/reconfigure script. Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode --- bin/trace | 1 + configure | 2 +- src/H5Pocpypl.c | 4 ++++ test/Makefile.in | 43 ++++++++++++++++++++++--------------------- 4 files changed, 28 insertions(+), 22 deletions(-) diff --git a/bin/trace b/bin/trace index 0235049..a35e106 100755 --- a/bin/trace +++ b/bin/trace @@ -120,6 +120,7 @@ $Source = ""; "H5MM_free_t" => "x", "H5O_info_t" => "x", "H5O_iterate_t" => "x", + "H5O_mcdt_search_cb_t" => "x", "H5P_cls_create_func_t" => "x", "H5P_cls_copy_func_t" => "x", "H5P_cls_close_func_t" => "x", diff --git a/configure b/configure index ec43c82..6280eaf 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22140 2012-03-25 14:30:39Z hdftest . +# From configure.in Id: configure.in 22149 2012-03-26 20:26:06Z mamcgree . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.113. # diff --git a/src/H5Pocpypl.c b/src/H5Pocpypl.c index e61a0d7..23f8e4b 100644 --- a/src/H5Pocpypl.c +++ b/src/H5Pocpypl.c @@ -469,6 +469,7 @@ H5Padd_merge_committed_dtype_path(hid_t plist_id, const char *path) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*s", plist_id, path); /* Check parameters */ if(!path) @@ -528,6 +529,7 @@ H5Pfree_merge_committed_dtype_paths(hid_t plist_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE1("e", "i", plist_id); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) @@ -575,6 +577,7 @@ H5Pset_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t func, void *op_data) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE3("e", "ix*x", plist_id, func, op_data); /* Check if the callback function is NULL and the user data is non-NULL. * This is almost certainly an error as the user data will not be used. */ @@ -623,6 +626,7 @@ H5Pget_mcdt_search_cb(hid_t plist_id, H5O_mcdt_search_cb_t *func, void **op_data herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_API(FAIL) + H5TRACE3("e", "i*x**x", plist_id, func, op_data); /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id, H5P_OBJECT_COPY))) diff --git a/test/Makefile.in b/test/Makefile.in index d468cd9..626a029 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -101,7 +101,8 @@ am__EXEEXT_2 = gen_bad_ohdr$(EXEEXT) gen_bogus$(EXEEXT) \ gen_new_super$(EXEEXT) gen_noencoder$(EXEEXT) \ gen_nullspace$(EXEEXT) gen_udlinks$(EXEEXT) \ space_overflow$(EXEEXT) gen_filespace$(EXEEXT) \ - gen_specmetaread$(EXEEXT) gen_sizes_lheap$(EXEEXT) gen_file_image$(EXEEXT) + gen_specmetaread$(EXEEXT) gen_sizes_lheap$(EXEEXT) \ + gen_file_image$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) accum_SOURCES = accum.c accum_OBJECTS = accum.$(OBJEXT) @@ -239,6 +240,10 @@ gen_deflate_SOURCES = gen_deflate.c gen_deflate_OBJECTS = gen_deflate.$(OBJEXT) gen_deflate_LDADD = $(LDADD) gen_deflate_DEPENDENCIES = libh5test.la $(LIBHDF5) +gen_file_image_SOURCES = gen_file_image.c +gen_file_image_OBJECTS = gen_file_image.$(OBJEXT) +gen_file_image_LDADD = $(LDADD) +gen_file_image_DEPENDENCIES = libh5test.la $(LIBHDF5) gen_filespace_SOURCES = gen_filespace.c gen_filespace_OBJECTS = gen_filespace.$(OBJEXT) gen_filespace_LDADD = $(LDADD) @@ -287,10 +292,6 @@ gen_udlinks_SOURCES = gen_udlinks.c gen_udlinks_OBJECTS = gen_udlinks.$(OBJEXT) gen_udlinks_LDADD = $(LDADD) gen_udlinks_DEPENDENCIES = libh5test.la $(LIBHDF5) -gen_file_image_SOURCES = gen_file_image.c -gen_file_image_OBJECTS = gen_file_image.$(OBJEXT) -gen_file_image_LDADD = $(LDADD) -gen_file_image_DEPENDENCIES = libh5test.la $(LIBHDF5) getname_SOURCES = getname.c getname_OBJECTS = getname.$(OBJEXT) getname_LDADD = $(LDADD) @@ -429,15 +430,15 @@ SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c bittests.c \ earray.c efc.c enum.c err_compat.c error_test.c extend.c \ external.c farray.c fheap.c file_image.c fillval.c \ filter_fail.c flush1.c flush2.c freespace.c gen_bad_ohdr.c \ - gen_bogus.c gen_cross.c gen_deflate.c gen_filespace.c \ - gen_filters.c gen_new_array.c gen_new_fill.c gen_new_group.c \ - gen_new_mtime.c gen_new_super.c gen_noencoder.c \ - gen_nullspace.c gen_sizes_lheap.c gen_specmetaread.c \ - gen_udlinks.c gen_file_image.c getname.c gheap.c hyperslab.c istore.c lheap.c \ - links.c links_env.c mf.c mount.c mtime.c ntypes.c objcopy.c \ - ohdr.c pool.c reserved.c set_extent.c space_overflow.c stab.c \ - tcheck_version.c $(testhdf5_SOURCES) testmeta.c \ - $(ttsafe_SOURCES) unlink.c vfd.c + gen_bogus.c gen_cross.c gen_deflate.c gen_file_image.c \ + gen_filespace.c gen_filters.c gen_new_array.c gen_new_fill.c \ + gen_new_group.c gen_new_mtime.c gen_new_super.c \ + gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \ + gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ + istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ + ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ + space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ + testmeta.c $(ttsafe_SOURCES) unlink.c vfd.c DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ bittests.c btree2.c cache.c cache_api.c cache_tagging.c \ cmpd_dset.c cross_read.c dangle.c dsets.c dt_arith.c \ @@ -445,10 +446,10 @@ DIST_SOURCES = $(libh5test_la_SOURCES) accum.c app_ref.c big.c \ error_test.c extend.c external.c farray.c fheap.c file_image.c \ fillval.c filter_fail.c flush1.c flush2.c freespace.c \ gen_bad_ohdr.c gen_bogus.c gen_cross.c gen_deflate.c \ - gen_filespace.c gen_filters.c gen_new_array.c gen_new_fill.c \ - gen_new_group.c gen_new_mtime.c gen_new_super.c \ + gen_file_image.c gen_filespace.c gen_filters.c gen_new_array.c \ + gen_new_fill.c gen_new_group.c gen_new_mtime.c gen_new_super.c \ gen_noencoder.c gen_nullspace.c gen_sizes_lheap.c \ - gen_specmetaread.c gen_udlinks.c gen_file_image.c getname.c gheap.c hyperslab.c \ + gen_specmetaread.c gen_udlinks.c getname.c gheap.c hyperslab.c \ istore.c lheap.c links.c links_env.c mf.c mount.c mtime.c \ ntypes.c objcopy.c ohdr.c pool.c reserved.c set_extent.c \ space_overflow.c stab.c tcheck_version.c $(testhdf5_SOURCES) \ @@ -1018,6 +1019,9 @@ gen_cross$(EXEEXT): $(gen_cross_OBJECTS) $(gen_cross_DEPENDENCIES) gen_deflate$(EXEEXT): $(gen_deflate_OBJECTS) $(gen_deflate_DEPENDENCIES) @rm -f gen_deflate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_deflate_OBJECTS) $(gen_deflate_LDADD) $(LIBS) +gen_file_image$(EXEEXT): $(gen_file_image_OBJECTS) $(gen_file_image_DEPENDENCIES) + @rm -f gen_file_image$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gen_file_image_OBJECTS) $(gen_file_image_LDADD) $(LIBS) gen_filespace$(EXEEXT): $(gen_filespace_OBJECTS) $(gen_filespace_DEPENDENCIES) @rm -f gen_filespace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_filespace_OBJECTS) $(gen_filespace_LDADD) $(LIBS) @@ -1054,9 +1058,6 @@ gen_specmetaread$(EXEEXT): $(gen_specmetaread_OBJECTS) $(gen_specmetaread_DEPEND gen_udlinks$(EXEEXT): $(gen_udlinks_OBJECTS) $(gen_udlinks_DEPENDENCIES) @rm -f gen_udlinks$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gen_udlinks_OBJECTS) $(gen_udlinks_LDADD) $(LIBS) -gen_file_image$(EXEEXT): $(gen_file_image_OBJECTS) $(gen_file_image_DEPENDENCIES) - @rm -f gen_file_image$(EXEEXT) - $(AM_V_CCLD)$(LINK) $(gen_file_image_OBJECTS) $(gen_file_image_LDADD) $(LIBS) getname$(EXEEXT): $(getname_OBJECTS) $(getname_DEPENDENCIES) @rm -f getname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getname_OBJECTS) $(getname_LDADD) $(LIBS) @@ -1171,6 +1172,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_bogus.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_cross.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_deflate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_filespace.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_filters.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_new_array.Po@am__quote@ @@ -1183,7 +1185,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_sizes_lheap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_specmetaread.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_udlinks.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gen_file_image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gheap.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/h5test.Plo@am__quote@ -- cgit v0.12 From 42306f8ed4ade51a8629b9c5a159d1afac5f617f Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 1 Apr 2012 18:53:17 -0500 Subject: [svn-r22233] Description: Correct several errors in fractal heap code: root indirect block was getting pinned/protected more than once, "single" free space sections weren't getting "re-parented" correctly when the heap transitioned between having a root indirect block and a root direct block, and several related issues. Also cleaned up some warnings in library/tests. Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Mac OSX/64 10.7.3 (amazon) w/debug --- src/H5FSprivate.h | 2 +- src/H5FSsection.c | 2 +- src/H5HF.c | 32 --------- src/H5HFbtree2.c | 8 +-- src/H5HFdbg.c | 195 +++++++++++++++++++++++++++++++++++++++++------------- src/H5HFhuge.c | 4 +- src/H5HFiblock.c | 146 +++++++++++++++++++++++++++++++++------- src/H5HFpkg.h | 19 +++++- src/H5HFsection.c | 52 +++------------ src/H5HFspace.c | 181 +++++++++++++++++++++++++++++++++++++++++++++++++- src/H5MF.c | 4 +- src/H5MFdbg.c | 4 +- test/fheap.c | 132 ++++++++++++++++++++++++++++++++++-- 13 files changed, 616 insertions(+), 165 deletions(-) diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index ca7104c..f6a0034 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -155,7 +155,7 @@ typedef struct H5FS_stat_t { } H5FS_stat_t; /* Typedef for iteration operations */ -typedef herr_t (*H5FS_operator_t)(const H5FS_section_info_t *sect, +typedef herr_t (*H5FS_operator_t)(H5FS_section_info_t *sect, void *operator_data/*in,out*/); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index 914fa58..0f126c2 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -2244,7 +2244,7 @@ H5FS_sect_assert(const H5FS_t *fspace) hsize_t separate_obj; /* The number of separate objects managed */ FUNC_ENTER_NOAPI_NOINIT_NOERR -#ifndef QAK +#ifdef QAK HDfprintf(stderr, "%s: fspace->tot_sect_count = %Hu\n", "H5FS_sect_assert", fspace->tot_sect_count); #endif /* QAK */ diff --git a/src/H5HF.c b/src/H5HF.c index 9c911fd..a9750c9 100644 --- a/src/H5HF.c +++ b/src/H5HF.c @@ -156,9 +156,6 @@ H5HF_create(H5F_t *f, hid_t dxpl_id, const H5HF_create_t *cparam) H5HF_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(NULL) -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ /* * Check arguments. @@ -234,14 +231,8 @@ H5HF_open(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Load the heap header into memory */ -#ifdef QAK -HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); -#endif /* QAK */ if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_READ))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, NULL, "unable to protect fractal heap header") -#ifdef QAK -HDfprintf(stderr, "%s: hdr->rc = %u, hdr->fspace = %p\n", FUNC, hdr->rc, hdr->fspace); -#endif /* QAK */ /* Check for pending heap deletion */ if(hdr->pending_delete) @@ -361,9 +352,6 @@ H5HF_insert(H5HF_t *fh, hid_t dxpl_id, size_t size, const void *obj, herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: size = %Zu\n", FUNC, size); -#endif /* QAK */ /* Sanity check */ HDassert(fh); @@ -406,9 +394,6 @@ HGOTO_ERROR(H5E_HEAP, H5E_UNSUPPORTED, FAIL, "'write once' managed blocks not su } /* end else */ done: -#ifdef QAK -HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); -#endif /* QAK */ FUNC_LEAVE_NOAPI(ret_value) } /* end H5HF_insert() */ @@ -580,9 +565,6 @@ H5HF_write(H5HF_t *fh, hid_t dxpl_id, void *_id, hbool_t UNUSED *id_changed, herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ /* * Check arguments. @@ -720,9 +702,6 @@ H5HF_remove(H5HF_t *fh, hid_t dxpl_id, const void *_id) herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) -#ifdef QAK -HDfprintf(stderr, "%s: Called\n", FUNC); -#endif /* QAK */ /* * Check arguments. @@ -814,17 +793,9 @@ H5HF_close(H5HF_t *fh, hid_t dxpl_id) * a reference loop and the objects couldn't be removed from * the metadata cache - QAK) */ -#ifdef QAK -HDfprintf(stderr, "%s; fh->hdr->man_iter_off = %Hu\n", FUNC, fh->hdr->man_iter_off); -HDfprintf(stderr, "%s; fh->hdr->man_size = %Hu\n", FUNC, fh->hdr->man_size); -HDfprintf(stderr, "%s; fh->hdr->rc = %Zu\n", FUNC, fh->hdr->rc); -#endif /* QAK */ if(H5HF_man_iter_ready(&fh->hdr->next_block)) if(H5HF_man_iter_reset(&fh->hdr->next_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTRELEASE, FAIL, "can't reset block iterator") -#ifdef QAK -HDfprintf(stderr, "%s; After iterator reset fh->hdr->rc = %Zu\n", FUNC, fh->hdr->rc); -#endif /* QAK */ /* Shut down the huge object information */ /* (Can't put this in header "destroy" routine, because it has @@ -900,9 +871,6 @@ H5HF_delete(H5F_t *f, hid_t dxpl_id, haddr_t fh_addr) HDassert(H5F_addr_defined(fh_addr)); /* Lock the heap header into memory */ -#ifdef QAK -HDfprintf(stderr, "%s: fh_addr = %a\n", FUNC, fh_addr); -#endif /* QAK */ if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, fh_addr, H5AC_WRITE))) HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") diff --git a/src/H5HFbtree2.c b/src/H5HFbtree2.c index 023344c..34b74d7 100644 --- a/src/H5HFbtree2.c +++ b/src/H5HFbtree2.c @@ -352,7 +352,7 @@ HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %Hu}\n", "H5HF_huge_bt2_indir_found", herr_t H5HF_huge_bt2_indir_remove(const void *nrecord, void *_udata) { - H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ + H5HF_huge_remove_ud_t *udata = (H5HF_huge_remove_ud_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -570,7 +570,7 @@ HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %x, %Hu, %Hu}\n", "H5HF_huge_bt2_filt herr_t H5HF_huge_bt2_filt_indir_remove(const void *nrecord, void *_udata) { - H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ + H5HF_huge_remove_ud_t *udata = (H5HF_huge_remove_ud_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -759,7 +759,7 @@ H5HF_huge_bt2_filt_indir_debug(FILE *stream, const H5F_t UNUSED *f, hid_t UNUSED herr_t H5HF_huge_bt2_dir_remove(const void *nrecord, void *_udata) { - H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ + H5HF_huge_remove_ud_t *udata = (H5HF_huge_remove_ud_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -984,7 +984,7 @@ HDfprintf(stderr, "%s: nrecord = {%a, %Hu, %x, %Hu}\n", "H5HF_huge_bt2_filt_dir_ herr_t H5HF_huge_bt2_filt_dir_remove(const void *nrecord, void *_udata) { - H5HF_huge_remove_ud1_t *udata = (H5HF_huge_remove_ud1_t *)_udata; /* User callback data */ + H5HF_huge_remove_ud_t *udata = (H5HF_huge_remove_ud_t *)_udata; /* User callback data */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5HFdbg.c b/src/H5HFdbg.c index 4289c02..caaedc7 100644 --- a/src/H5HFdbg.c +++ b/src/H5HFdbg.c @@ -172,39 +172,31 @@ H5HF_dtable_debug(H5HF_dtable_t *dtable, FILE *stream, int indent, int fwidth) /*------------------------------------------------------------------------- - * Function: H5HF_hdr_debug + * Function: H5HF_hdr_print * - * Purpose: Prints debugging info about a fractal heap header. + * Purpose: Prints info about a fractal heap header. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Feb 24 2006 + * koziol@hdfgroup.org + * Feb 23 2012 * *------------------------------------------------------------------------- */ -herr_t -H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +void +H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, hbool_t dump_internal, FILE *stream, int indent, int fwidth) { - H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ - herr_t ret_value = SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(hdr); HDassert(stream); HDassert(indent >= 0); HDassert(fwidth >= 0); - /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") - /* Print opening message */ HDfprintf(stream, "%*sFractal Heap Header...\n", indent, ""); @@ -277,10 +269,66 @@ H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, "Filter mask for root direct block:", hdr->pline_root_direct_filter_mask); } /* end if */ - H5O_debug_id(H5O_PLINE_ID, f, dxpl_id, &(hdr->pline), stream, + H5O_debug_id(H5O_PLINE_ID, hdr->f, dxpl_id, &(hdr->pline), stream, indent + 3, MAX(0, fwidth - 3)); } /* end if */ + /* Print internal (runtime) information, if requested */ + if(dump_internal) { + HDfprintf(stream, "%*sFractal Heap Header Internal Information:\n", indent, ""); + + /* Dump root iblock, if there is one */ + HDfprintf(stream, "%*s%-*s %x\n", indent + 3, "", MAX(0, fwidth - 3), + "Root indirect block flags:", + hdr->root_iblock_flags); + HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3), + "Root indirect block pointer:", + hdr->root_iblock); + if(hdr->root_iblock) + H5HF_iblock_print(hdr->root_iblock, dump_internal, stream, indent + 3, fwidth); + } /* end if */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5HF_hdr_print() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_hdr_debug + * + * Purpose: Prints debugging info about a fractal heap header. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Feb 24 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth) +{ + H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* + * Check arguments. + */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") + + /* Print the information about the heap's header */ + H5HF_hdr_print(hdr, dxpl_id, FALSE, stream, indent, fwidth); + done: if(hdr && H5AC_unprotect(f, dxpl_id, H5AC_FHEAP_HDR, addr, hdr, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap header") @@ -303,9 +351,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_dblock_debug_cb(const H5FS_section_info_t *_sect, void *_udata) +H5HF_dblock_debug_cb(H5FS_section_info_t *_sect, void *_udata) { - const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */ + H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ H5HF_debug_iter_ud1_t *udata = (H5HF_debug_iter_ud1_t *)_udata; /* User data for callbacks */ haddr_t sect_start, sect_end; /* Section's beginning and ending offsets */ haddr_t dblock_start, dblock_end; /* Direct block's beginning and ending offsets */ @@ -501,51 +549,39 @@ done: /*------------------------------------------------------------------------- - * Function: H5HF_iblock_debug + * Function: H5HF_iblock_print * * Purpose: Prints debugging info about a fractal heap indirect block. * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol - * koziol@ncsa.uiuc.edu - * Mar 7 2006 + * koziol@hdfgroup.org + * Feb 23 2012 * *------------------------------------------------------------------------- */ -herr_t -H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, - int indent, int fwidth, haddr_t hdr_addr, unsigned nrows) +void +H5HF_iblock_print(const H5HF_indirect_t *iblock, + hbool_t dump_internal, FILE *stream, int indent, int fwidth) { - H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ - H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ - hbool_t did_protect; /* Whether we protected the indirect block or not */ + const H5HF_hdr_t *hdr; /* Pointer to heap's header */ char temp_str[64]; /* Temporary string, for formatting */ size_t u, v; /* Local index variable */ - herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT /* * Check arguments. */ - HDassert(f); - HDassert(H5F_addr_defined(addr)); + HDassert(iblock); + HDassert(iblock->hdr); HDassert(stream); HDassert(indent >= 0); HDassert(fwidth >= 0); - HDassert(H5F_addr_defined(hdr_addr)); - HDassert(nrows > 0); - /* Load the fractal heap header */ - if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") - - /* - * Load the heap indirect block - */ - if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC_READ, &did_protect))) - HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") + /* Set up convenience variables */ + hdr = iblock->hdr; /* Print opening message */ HDfprintf(stream, "%*sFractal Heap Indirect Block...\n", indent, ""); @@ -623,6 +659,75 @@ H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), ""); + /* Print internal (runtime) information, if requested */ + if(dump_internal) { + HDfprintf(stream, "%*sFractal Indirect Block Internal Information:\n", indent, ""); + + /* Print general information */ + HDfprintf(stream, "%*s%-*s %Zu\n", indent + 3, "", MAX(0, fwidth - 3), + "Reference count:", + iblock->rc); + + /* Print parent's information */ + HDfprintf(stream, "%*s%-*s %p\n", indent + 3, "", MAX(0, fwidth - 3), + "Parent indirect block address:", + iblock->parent); + if(iblock->parent) + H5HF_iblock_print(iblock->parent, TRUE, stream, indent + 6, fwidth); + } /* end if */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5HF_iblock_print() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_iblock_debug + * + * Purpose: Prints debugging info about a fractal heap indirect block. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: Quincey Koziol + * koziol@ncsa.uiuc.edu + * Mar 7 2006 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, + int indent, int fwidth, haddr_t hdr_addr, unsigned nrows) +{ + H5HF_hdr_t *hdr = NULL; /* Fractal heap header info */ + H5HF_indirect_t *iblock = NULL; /* Fractal heap direct block info */ + hbool_t did_protect; /* Whether we protected the indirect block or not */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + /* + * Check arguments. + */ + HDassert(f); + HDassert(H5F_addr_defined(addr)); + HDassert(stream); + HDassert(indent >= 0); + HDassert(fwidth >= 0); + HDassert(H5F_addr_defined(hdr_addr)); + HDassert(nrows > 0); + + /* Load the fractal heap header */ + if(NULL == (hdr = H5HF_hdr_protect(f, dxpl_id, hdr_addr, H5AC_READ))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTPROTECT, FAIL, "unable to protect fractal heap header") + + /* + * Load the heap indirect block + */ + if(NULL == (iblock = H5HF_man_iblock_protect(hdr, dxpl_id, addr, nrows, NULL, 0, FALSE, H5AC_READ, &did_protect))) + HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load fractal heap indirect block") + + /* Print the information about the heap's indirect block */ + H5HF_iblock_print(iblock, FALSE, stream, indent, fwidth); + done: if(iblock && H5HF_man_iblock_unprotect(iblock, dxpl_id, H5AC__NO_FLAGS_SET, did_protect) < 0) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release fractal heap direct block") @@ -647,9 +752,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5HF_sects_debug_cb(const H5FS_section_info_t *_sect, void *_udata) +H5HF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) { - const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Section to dump info */ + H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ H5HF_debug_iter_ud2_t *udata = (H5HF_debug_iter_ud2_t *)_udata; /* User data for callbacks */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5HFhuge.c b/src/H5HFhuge.c index 3bbd137..6f0b48e 100644 --- a/src/H5HFhuge.c +++ b/src/H5HFhuge.c @@ -899,7 +899,7 @@ done: herr_t H5HF_huge_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, const uint8_t *id) { - H5HF_huge_remove_ud1_t udata; /* User callback data for v2 B-tree remove call */ + H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1072,7 +1072,7 @@ done: herr_t H5HF_huge_delete(H5HF_hdr_t *hdr, hid_t dxpl_id) { - H5HF_huge_remove_ud1_t udata; /* User callback data for v2 B-tree remove call */ + H5HF_huge_remove_ud_t udata; /* User callback data for v2 B-tree remove call */ H5B2_remove_t op; /* Callback for v2 B-tree removal */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5HFiblock.c b/src/H5HFiblock.c index 6c19b4f..342e228 100644 --- a/src/H5HFiblock.c +++ b/src/H5HFiblock.c @@ -140,8 +140,17 @@ H5HF_iblock_pin(H5HF_indirect_t *iblock) else { /* Check for pinning the root indirect block */ if(iblock->block_off == 0) { - HDassert(iblock->hdr->root_iblock == NULL); - iblock->hdr->root_iblock = iblock; + /* Sanity check - shouldn't be recursively pinning root indirect block */ + HDassert(0 == (iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED)); + + /* Check if we should set the root iblock pointer */ + if(0 == iblock->hdr->root_iblock_flags) { + HDassert(NULL == iblock->hdr->root_iblock); + iblock->hdr->root_iblock = iblock; + } /* end if */ + + /* Indicate that the root indirect block is pinned */ + iblock->hdr->root_iblock_flags |= H5HF_ROOT_IBLOCK_PINNED; } /* end if */ } /* end if */ @@ -192,12 +201,21 @@ H5HF_iblock_unpin(H5HF_indirect_t *iblock) par_iblock->child_iblocks[indir_idx] = NULL; } /* end if */ else { - /* Check for unpinning the root indirect block */ + /* Check for root indirect block */ if(iblock->block_off == 0) { - HDassert(iblock->hdr->root_iblock); - iblock->hdr->root_iblock = NULL; + /* Sanity check - shouldn't be recursively unpinning root indirect block */ + HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PINNED); + + /* Check if we should reset the root iblock pointer */ + if(H5HF_ROOT_IBLOCK_PINNED == iblock->hdr->root_iblock_flags) { + HDassert(NULL != iblock->hdr->root_iblock); + iblock->hdr->root_iblock = NULL; + } /* end if */ + + /* Indicate that the root indirect block is unpinned */ + iblock->hdr->root_iblock_flags &= ~(H5HF_ROOT_IBLOCK_PINNED); } /* end if */ - } /* end if */ + } /* end else */ /* Mark block as evictable again */ if(H5AC_unpin_entry(iblock) < 0) @@ -273,18 +291,23 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) /* Mark block as evictable again when no child blocks depend on it */ if(iblock->rc == 0) { - if(H5HF_iblock_unpin(iblock) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") + H5HF_hdr_t *hdr; /* Fractal heap header */ + haddr_t iblock_addr; /* Address of fractal heap */ + hbool_t expunge_iblock = FALSE; /* Whether to expunge indirect block from heap */ + + /* Set up convenience variables */ + hdr = iblock->hdr; + iblock_addr = iblock->addr; if(iblock->nchildren == 0) { /* Check for deleting root indirect block (and no root direct block) */ - if(iblock->block_off == 0 && iblock->hdr->man_dtable.curr_root_rows > 0) { + if(iblock->block_off == 0 && hdr->man_dtable.curr_root_rows > 0) { /* Reset root pointer information */ - iblock->hdr->man_dtable.curr_root_rows = 0; - iblock->hdr->man_dtable.table_addr = HADDR_UNDEF; + hdr->man_dtable.curr_root_rows = 0; + hdr->man_dtable.table_addr = HADDR_UNDEF; /* Reset header information back to "empty heap" state */ - if(H5HF_hdr_empty(iblock->hdr) < 0) + if(H5HF_hdr_empty(hdr) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTSHRINK, FAIL, "can't make heap empty") } /* end if */ @@ -297,8 +320,18 @@ H5HF_iblock_decr(H5HF_indirect_t *iblock) iblock->par_entry = 0; } /* end if */ + /* Mark indirect block for removal from the metadata cache */ + expunge_iblock = TRUE; + } /* end if */ + + /* Unpin the indirect block */ + if(H5HF_iblock_unpin(iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPIN, FAIL, "unable to unpin fractal heap indirect block") + + /* Check for expunging the indirect block from the metadata cache */ + if(expunge_iblock) { /* Evict the indirect block from the metadata cache */ - if(H5AC_expunge_entry(iblock->hdr->f, H5AC_dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) + if(H5AC_expunge_entry(hdr->f, H5AC_dxpl_id, H5AC_FHEAP_IBLOCK, iblock_addr, H5AC__FREE_FILE_SPACE_FLAG) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTREMOVE, FAIL, "unable to remove indirect block from cache") } /* end if */ } /* end if */ @@ -420,6 +453,10 @@ H5HF_man_iblock_root_create(H5HF_hdr_t *hdr, hid_t dxpl_id, size_t min_dblock_si hdr->pline_root_direct_filter_mask = 0; } /* end if */ + /* Scan free space sections to set any 'parent' pointers to new indirect block */ + if(H5HF_space_create_root(hdr, dxpl_id, iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTSET, FAIL, "can't set free space section info to new root indirect block") + /* Unlock first (previously the root) direct block */ if(H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, hdr->man_dtable.table_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") @@ -859,6 +896,11 @@ H5HF_man_iblock_root_revert(H5HF_indirect_t *root_iblock, hid_t dxpl_id) if(H5HF_hdr_adjust_heap(hdr, (hsize_t)hdr->man_dtable.cparam.start_block_size, (hssize_t)hdr->man_dtable.row_tot_dblock_free[0]) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTEXTEND, FAIL, "can't increase space to cover root direct block") + /* Scan free space sections to reset any 'parent' pointers */ + if(H5HF_space_revert_root(hdr, dxpl_id) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTRESET, FAIL, "can't reset free space section info") + + done: if(dblock && H5AC_unprotect(hdr->f, dxpl_id, H5AC_FHEAP_DBLOCK, dblock_addr, dblock, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap direct block") @@ -1126,11 +1168,20 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, else { /* Check for root indirect block */ if(H5F_addr_eq(iblock_addr, hdr->man_dtable.table_addr)) { - /* Check for pointer to pinned indirect block in root */ - if(hdr->root_iblock) + /* Check for valid pointer to pinned indirect block in root */ + if(H5HF_ROOT_IBLOCK_PINNED == hdr->root_iblock_flags) { + /* Sanity check */ + HDassert(NULL != hdr->root_iblock); + + /* Return the pointer to the pinned root indirect block */ iblock = hdr->root_iblock; - else + } /* end if */ + else { + /* Sanity check */ + HDassert(NULL == hdr->root_iblock); + should_protect = TRUE; + } /* end else */ } /* end if */ else should_protect = TRUE; @@ -1158,6 +1209,21 @@ H5HF_man_iblock_protect(H5HF_hdr_t *hdr, hid_t dxpl_id, haddr_t iblock_addr, /* Set the indirect block's address */ iblock->addr = iblock_addr; + /* Check for root indirect block */ + if(iblock->block_off == 0) { + /* Sanity check - shouldn't be recursively protecting root indirect block */ + HDassert(0 == (hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED)); + + /* Check if we should set the root iblock pointer */ + if(0 == hdr->root_iblock_flags) { + HDassert(NULL == hdr->root_iblock); + hdr->root_iblock = iblock; + } /* end if */ + + /* Indicate that the root indirect block is protected */ + hdr->root_iblock_flags |= H5HF_ROOT_IBLOCK_PROTECTED; + } /* end if */ + /* Indicate that the indirect block was protected */ *did_protect = TRUE; } /* end if */ @@ -1202,6 +1268,21 @@ H5HF_man_iblock_unprotect(H5HF_indirect_t *iblock, hid_t dxpl_id, /* Check if we previously protected this indirect block */ /* (as opposed to using an existing pointer to a pinned child indirect block) */ if(did_protect) { + /* Check for root indirect block */ + if(iblock->block_off == 0) { + /* Sanity check - shouldn't be recursively unprotecting root indirect block */ + HDassert(iblock->hdr->root_iblock_flags & H5HF_ROOT_IBLOCK_PROTECTED); + + /* Check if we should reset the root iblock pointer */ + if(H5HF_ROOT_IBLOCK_PROTECTED == iblock->hdr->root_iblock_flags) { + HDassert(NULL != iblock->hdr->root_iblock); + iblock->hdr->root_iblock = NULL; + } /* end if */ + + /* Indicate that the root indirect block is unprotected */ + iblock->hdr->root_iblock_flags &= ~(H5HF_ROOT_IBLOCK_PROTECTED); + } /* end if */ + /* Unprotect the indirect block */ if(H5AC_unprotect(iblock->hdr->f, dxpl_id, H5AC_FHEAP_IBLOCK, iblock->addr, iblock, cache_flags) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTUNPROTECT, FAIL, "unable to release fractal heap indirect block") @@ -1215,7 +1296,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF_man_iblock_attach * - * Purpose: Attach a block to an indirect block + * Purpose: Attach a child block (direct or indirect) to an indirect block * * Return: SUCCEED/FAIL * @@ -1243,7 +1324,7 @@ H5HF_man_iblock_attach(H5HF_indirect_t *iblock, unsigned entry, haddr_t child_ad if(H5HF_iblock_incr(iblock) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on shared indirect block") - /* Point at the direct block */ + /* Point at the child block */ iblock->ents[entry].addr = child_addr; /* Check for I/O filters on this heap */ @@ -1280,7 +1361,7 @@ done: /*------------------------------------------------------------------------- * Function: H5HF_man_iblock_detach * - * Purpose: Detach a block from an indirect block + * Purpose: Detach a child block (direct or indirect) from an indirect block * * Return: SUCCEED/FAIL * @@ -1293,6 +1374,7 @@ done: herr_t H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) { + unsigned row; /* Row for entry */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -1306,16 +1388,14 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) /* Reset address of entry */ iblock->ents[entry].addr = HADDR_UNDEF; + /* Compute row for entry */ + row = entry / iblock->hdr->man_dtable.cparam.width; + /* Check for I/O filters on this heap */ if(iblock->hdr->filter_len > 0) { - unsigned row; /* Row for entry */ - /* Sanity check */ HDassert(iblock->filt_ents); - /* Compute row for entry */ - row = entry / iblock->hdr->man_dtable.cparam.width; - /* If this is a direct block, reset its initial size */ if(row < iblock->hdr->man_dtable.max_direct_rows) { iblock->filt_ents[entry].size = 0; @@ -1323,6 +1403,24 @@ H5HF_man_iblock_detach(H5HF_indirect_t *iblock, hid_t dxpl_id, unsigned entry) } /* end if */ } /* end if */ + /* Check for indirect block being detached */ + if(row >= iblock->hdr->man_dtable.max_direct_rows) { + unsigned indir_idx; /* Index in parent's child iblock pointer array */ + + /* Sanity check */ + HDassert(iblock->child_iblocks); + + /* Compute index in child iblock pointer array */ + indir_idx = entry - (iblock->hdr->man_dtable.max_direct_rows + * iblock->hdr->man_dtable.cparam.width); + + /* Sanity check */ + HDassert(iblock->child_iblocks[indir_idx]); + + /* Reset pointer to child indirect block in parent */ + iblock->child_iblocks[indir_idx] = NULL; + } /* end if */ + /* Decrement the # of child blocks */ /* (If the number of children drop to 0, the indirect block will be * removed from the heap when its ref. count drops to zero and the diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 2746302..498c45e 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -174,6 +174,11 @@ #define H5HF_OP_MODIFY 0x0001 /* Operation will modify object */ #define H5HF_OP_FLAGS (H5HF_OP_MODIFY) /* Bit-wise OR of all op flags */ +/* Flags for 'root_iblock_flags' field in header */ +#define H5HF_ROOT_IBLOCK_PINNED 0x01 +#define H5HF_ROOT_IBLOCK_PROTECTED 0x02 + + /****************************/ /* Package Private Typedefs */ /****************************/ @@ -342,7 +347,8 @@ typedef struct H5HF_hdr_t { hbool_t pending_delete; /* Heap is pending deletion */ uint8_t sizeof_size; /* Size of file sizes */ uint8_t sizeof_addr; /* Size of file addresses */ - struct H5HF_indirect_t *root_iblock; /* Pointer to pinned root indirect block */ + struct H5HF_indirect_t *root_iblock; /* Pointer to root indirect block */ + unsigned root_iblock_flags; /* Flags to indicate whether root indirect block is pinned/protected */ H5FS_t *fspace; /* Free space list for objects in heap */ H5HF_block_iter_t next_block; /* Block iterator for searching for next block with space */ H5B2_t *huge_bt2; /* v2 B-tree handle for huge objects */ @@ -457,14 +463,14 @@ typedef struct H5HF_huge_bt2_filt_dir_rec_t { typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header */ hid_t dxpl_id; /* DXPL ID for operation */ -} H5HF_sect_add_ud1_t; +} H5HF_sect_add_ud_t; /* User data for v2 B-tree 'remove' callback on 'huge' objects */ typedef struct { H5HF_hdr_t *hdr; /* Fractal heap header (in) */ hid_t dxpl_id; /* DXPL ID for operation (in) */ hsize_t obj_len; /* Length of object removed (out) */ -} H5HF_huge_remove_ud1_t; +} H5HF_huge_remove_ud_t; /* User data for fractal heap header cache client callback */ typedef struct H5HF_hdr_cache_ud_t { @@ -701,10 +707,14 @@ H5_DLL herr_t H5HF_tiny_op(H5HF_hdr_t *hdr, const uint8_t *id, H5_DLL herr_t H5HF_tiny_remove(H5HF_hdr_t *fh, const uint8_t *id); /* Debugging routines for dumping file structures */ +H5_DLL void H5HF_hdr_print(const H5HF_hdr_t *hdr, hid_t dxpl_id, + hbool_t dump_internal, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_hdr_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_dblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, size_t nrec); +H5_DLL void H5HF_iblock_print(const H5HF_indirect_t *iblock, hbool_t dump_internal, + FILE *stream, int indent, int fwidth); H5_DLL herr_t H5HF_iblock_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fwidth, haddr_t hdr_addr, unsigned nrows); @@ -733,6 +743,9 @@ H5_DLL herr_t H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, unsigned flags); H5_DLL htri_t H5HF_space_find(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t request, H5HF_free_section_t **node); +H5_DLL herr_t H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id); +H5_DLL herr_t H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, + H5HF_indirect_t *root_iblock); H5_DLL herr_t H5HF_space_size(H5HF_hdr_t *hdr, hid_t dxpl_id, hsize_t *fs_size); H5_DLL herr_t H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node); diff --git a/src/H5HFsection.c b/src/H5HFsection.c index 38d9381..87fa069 100644 --- a/src/H5HFsection.c +++ b/src/H5HFsection.c @@ -665,42 +665,6 @@ H5HF_sect_single_dblock_info(H5HF_hdr_t *hdr, hid_t dxpl_id, HDassert(dblock_addr); HDassert(dblock_size); - /* Check for section in first direct block of heap */ - if(sect->sect_info.addr < hdr->man_dtable.cparam.start_block_size) { - /* Check for heap changing from direct <-> indirect root (or vice versa) - * while section was live. - */ - if(sect->u.single.parent) { - /* Check for heap converting from indirect root to direct root while section was live */ - if(hdr->man_dtable.curr_root_rows == 0) { - /* Release hold on parent indirect block */ - if(H5HF_iblock_decr(sect->u.single.parent) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") - - /* Reset parent information */ - sect->u.single.parent = NULL; - sect->u.single.par_entry = 0; - } /* end if */ - else { - /* Check for heap converting from indirect to direct and back - * to indirect again, which would indicate a different - * indirect root block would be used for the parent of - * this section and the actual root indirect block. - */ - if(H5HF_sect_single_locate_parent(hdr, dxpl_id, TRUE, sect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get section's parent info") - } /* end else */ - } /* end if */ - else { - /* Check for heap converting from direct root to indirect root while section was live */ - if(hdr->man_dtable.curr_root_rows != 0) { - /* Look up indirect block information for section */ - if(H5HF_sect_single_locate_parent(hdr, dxpl_id, FALSE, sect) < 0) - HGOTO_ERROR(H5E_HEAP, H5E_CANTGET, FAIL, "can't get section's parent info") - } /* end if */ - } /* end else */ - } /* end if */ - /* Check for root direct block */ if(hdr->man_dtable.curr_root_rows == 0) { /* Retrieve direct block info from heap header */ @@ -860,7 +824,7 @@ H5HF_sect_single_add(H5FS_section_info_t *_sect, unsigned *flags, void *_udata) */ if(!(*flags & H5FS_ADD_DESERIALIZING)) { H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ @@ -992,7 +956,7 @@ H5HF_sect_single_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, { H5HF_free_section_t *sect1 = (H5HF_free_section_t *)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1050,7 +1014,7 @@ static htri_t H5HF_sect_single_can_shrink(const H5FS_section_info_t *_sect, void *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ @@ -1105,7 +1069,7 @@ static herr_t H5HF_sect_single_shrink(H5FS_section_info_t **_sect, void UNUSED *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ H5HF_direct_t *dblock; /* Pointer to direct block for section */ @@ -1814,7 +1778,7 @@ H5HF_sect_row_merge(H5FS_section_info_t *_sect1, H5FS_section_info_t *_sect2, { H5HF_free_section_t *sect1 = (H5HF_free_section_t *)_sect1; /* Fractal heap free section */ H5HF_free_section_t *sect2 = (H5HF_free_section_t *)_sect2; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ @@ -1881,7 +1845,7 @@ static htri_t H5HF_sect_row_can_shrink(const H5FS_section_info_t *_sect, void UNUSED *_udata) { const H5HF_free_section_t *sect = (const H5HF_free_section_t *)_sect; /* Fractal heap free section */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ htri_t ret_value = FALSE; /* Return value */ @@ -1919,7 +1883,7 @@ H5HF_sect_row_shrink(H5FS_section_info_t **_sect, void *_udata) { H5HF_free_section_t **sect = (H5HF_free_section_t **)_sect; /* Fractal heap free section */ H5HF_free_section_t *top_indir_sect; /* Top indirect section for row */ - H5HF_sect_add_ud1_t *udata = (H5HF_sect_add_ud1_t *)_udata; /* User callback data */ + H5HF_sect_add_ud_t *udata = (H5HF_sect_add_ud_t *)_udata; /* User callback data */ H5HF_hdr_t *hdr = udata->hdr; /* Fractal heap header */ hid_t dxpl_id = udata->dxpl_id; /* DXPL ID for operation */ herr_t ret_value = SUCCEED; /* Return value */ @@ -2161,7 +2125,7 @@ H5HF_sect_indirect_iblock_off(const H5HF_free_section_t *sect) * * Purpose: Get the "top" indirect section * - * Return: Pointer to the top indirect sectin (can't fail) + * Return: Pointer to the top indirect section (can't fail) * * Programmer: Quincey Koziol * koziol@ncsa.uiuc.edu diff --git a/src/H5HFspace.c b/src/H5HFspace.c index cec9b3a..01330d3 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -168,7 +168,7 @@ herr_t H5HF_space_add(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *node, unsigned flags) { - H5HF_sect_add_ud1_t udata; /* User data for free space manager 'add' */ + H5HF_sect_add_ud_t udata; /* User data for free space manager 'add' */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT @@ -246,6 +246,185 @@ done: /*------------------------------------------------------------------------- + * Function: H5HF_space_revert_root_cb + * + * Purpose: Callback routine from iterator, to reset 'parent' pointers in + * sections, when the heap is changing from having a root indirect + * block to a direct block. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Feb 24 2012 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_space_revert_root_cb(H5FS_section_info_t *_sect, void UNUSED *_udata) +{ + H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(sect); + + /* Only modify "live" single blocks... */ + if(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE && sect->sect_info.state == H5FS_SECT_LIVE) { + /* Release hold on previous indirect block (we must have one) */ + HDassert(sect->u.single.parent); + if(H5HF_iblock_decr(sect->u.single.parent) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTDEC, FAIL, "can't decrement reference count on section's indirect block") + + /* Reset parent information */ + sect->u.single.parent = NULL; + sect->u.single.par_entry = 0; + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_space_revert_root_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_space_revert_root + * + * Purpose: Reset 'parent' pointers in sections, when the heap is + * changing from having a root indirect block to a direct block. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Feb 23 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_space_revert_root(const H5HF_hdr_t *hdr, hid_t dxpl_id) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(hdr); + + /* Only need to scan the sections if the free space has been initialized */ + if(hdr->fspace) { + /* Iterate over all sections, reseting the parent pointers in 'single' sections */ + if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_revert_root_cb, NULL) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to reset parent pointers") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_space_revert_root() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_space_create_root_cb + * + * Purpose: Callback routine from iterator, to set 'parent' pointers in + * sections to newly created root indirect block, when the heap + * is changing from having a root direct block to an indirect block. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Feb 24 2012 + * + *------------------------------------------------------------------------- + */ +static herr_t +H5HF_space_create_root_cb(H5FS_section_info_t *_sect, void *_udata) +{ + H5HF_free_section_t *sect = (H5HF_free_section_t *)_sect; /* Section to dump info */ + H5HF_indirect_t *root_iblock = (H5HF_indirect_t *)_udata; /* User data for callback */ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(sect); + HDassert(root_iblock); + + /* Sanity check sections */ + /* (If we are switching from a direct block for the root block of the heap, */ + /* there should only be 'single' type sections. -QAK) */ + HDassert(sect->sect_info.type == H5HF_FSPACE_SECT_SINGLE); + + /* Increment ref. count on new root indirect block */ + if(H5HF_iblock_incr(root_iblock) < 0) + HGOTO_ERROR(H5E_HEAP, H5E_CANTINC, FAIL, "can't increment reference count on section's indirect block") + + /* Set parent info ("live" section must _NOT_ have a parent right now) */ + if(sect->sect_info.state == H5FS_SECT_SERIALIZED) + sect->sect_info.state = H5FS_SECT_LIVE; /* Mark "live" now */ + else + HDassert(!sect->u.single.parent); + sect->u.single.parent = root_iblock; + sect->u.single.par_entry = 0; + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_space_create_root_cb() */ + + +/*------------------------------------------------------------------------- + * Function: H5HF_space_create_root + * + * Purpose: Set 'parent' pointers in sections to new indirect block, when + * the heap is changing from having a root direct block to a + * indirect block. + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Quincey Koziol + * koziol@hdfgroup.org + * Feb 24 2012 + * + *------------------------------------------------------------------------- + */ +herr_t +H5HF_space_create_root(const H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_indirect_t *root_iblock) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI_NOINIT + + /* + * Check arguments. + */ + HDassert(hdr); + HDassert(root_iblock); + + /* Only need to scan the sections if the free space has been initialized */ + if(hdr->fspace) { + /* Iterate over all sections, seting the parent pointers in 'single' sections to the new indirect block */ + if(H5FS_sect_iterate(hdr->f, dxpl_id, hdr->fspace, H5HF_space_create_root_cb, root_iblock) < 0) + HGOTO_ERROR(H5E_FSPACE, H5E_BADITER, FAIL, "can't iterate over sections to set parent pointers") + } /* end if */ + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5HF_space_create_root() */ + + +/*------------------------------------------------------------------------- * Function: H5HF_space_size * * Purpose: Query the size of the heap's free space info on disk diff --git a/src/H5MF.c b/src/H5MF.c index fce151e..f9ca256 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -1172,9 +1172,9 @@ HDfprintf(stderr, "%s: Leaving\n", FUNC); *------------------------------------------------------------------------- */ static herr_t -H5MF_sects_cb(const H5FS_section_info_t *_sect, void *_udata) +H5MF_sects_cb(H5FS_section_info_t *_sect, void *_udata) { - const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; + H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect; H5MF_sect_iter_ud_t *udata = (H5MF_sect_iter_ud_t *)_udata; FUNC_ENTER_NOAPI_NOINIT_NOERR diff --git a/src/H5MFdbg.c b/src/H5MFdbg.c index bdc811f..d6fc5ce 100644 --- a/src/H5MFdbg.c +++ b/src/H5MFdbg.c @@ -99,9 +99,9 @@ typedef struct { *------------------------------------------------------------------------- */ static herr_t -H5MF_sects_debug_cb(const H5FS_section_info_t *_sect, void *_udata) +H5MF_sects_debug_cb(H5FS_section_info_t *_sect, void *_udata) { - const H5MF_free_section_t *sect = (const H5MF_free_section_t *)_sect; /* Section to dump info */ + H5MF_free_section_t *sect = (H5MF_free_section_t *)_sect; /* Section to dump info */ H5MF_debug_iter_ud_t *udata = (H5MF_debug_iter_ud_t *)_udata; /* User data for callbacks */ herr_t ret_value = SUCCEED; /* Return value */ diff --git a/test/fheap.c b/test/fheap.c index 14cfbe8..e4aa137 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -508,6 +508,7 @@ get_fill_size(const fheap_test_param_t *tparam) case FHEAP_TEST_FILL_SINGLE: return((size_t)0); + case FHEAP_TEST_FILL_N: default: HDassert(0 && "Unknown bulk fill type?!?"); } /* end switch */ @@ -6453,7 +6454,7 @@ test_man_remove_bogus(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tpa /* seed = (unsigned long)1155438845; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); #endif /* QAK */ - HDsrandom(seed); + HDsrandom((unsigned)seed); /* Set heap ID to random (non-null) value */ heap_id[0] = H5HF_ID_VERS_CURR | H5HF_ID_TYPE_MAN; @@ -7594,6 +7595,117 @@ error: } H5E_END_TRY; return(1); } /* test_man_remove_three_larger() */ + + +/*------------------------------------------------------------------------- + * Function: test_man_incr_insert_remove + * + * Purpose: Test incremental insert & removal of objects in heap + * + * Return: Success: 0 + * Failure: 1 + * + * Programmer: Quincey Koziol + * Sunday, April 1, 2012 + * + *------------------------------------------------------------------------- + */ +static unsigned +test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) +{ + hid_t file = -1; /* File ID */ + hid_t dxpl = H5P_DATASET_XFER_DEFAULT; /* DXPL to use */ + char filename[FHEAP_FILENAME_LEN]; /* Filename to use */ + H5F_t *f = NULL; /* Internal file object pointer */ + H5HF_t *fh = NULL; /* Fractal heap wrapper */ + haddr_t fh_addr; /* Address of fractal heap */ + unsigned char heap_id[100][MAX_HEAP_ID_LEN]; /* Heap ID for object inserted */ + struct a_type_t1 { + char a[10]; + char b[29]; + } obj1, obj2; /* Objects to insert/remove */ + size_t id_len; /* Size of fractal heap IDs */ + fheap_heap_state_t state; /* State of fractal heap */ + int i, j; + + /* Set the filename to use for this test (dependent on fapl) */ + h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); + + /* Create the file to work on */ + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + FAIL_STACK_ERROR + + /* Get a pointer to the internal file object */ + if(NULL == (f = (H5F_t *)H5I_object(file))) + STACK_ERROR + + /* Ignore metadata tags in the file's cache */ + if(H5AC_ignore_tags(f) < 0) + STACK_ERROR + + /* Create absolute heap */ + if(NULL == (fh = H5HF_create(f, dxpl, cparam))) + FAIL_STACK_ERROR + if(H5HF_get_id_len(fh, &id_len) < 0) + FAIL_STACK_ERROR + if(id_len > HEAP_ID_LEN) + FAIL_STACK_ERROR + if(H5HF_get_heap_addr(fh, &fh_addr) < 0) + FAIL_STACK_ERROR + if(!H5F_addr_defined(fh_addr)) + FAIL_STACK_ERROR + HDmemset(&state, 0, sizeof(fheap_heap_state_t)); + if(check_stats(fh, &state)) + FAIL_STACK_ERROR + + /* + * Test incremental insert and removal + */ + TESTING("incremental object insertion and removal") + + for(i = 0; i < 100; i++) { + sprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); + + for(j = 0; j < i; j++) { + sprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); + + if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) + FAIL_STACK_ERROR + if(H5HF_insert(fh, dxpl, (sizeof(obj2)), &obj2, heap_id[j]) < 0) + FAIL_STACK_ERROR + } /* end for */ + + /* Check for closing & re-opening the heap */ + if(reopen_heap(f, dxpl, &fh, fh_addr, tparam) < 0) + TEST_ERROR + + /* Insert object */ + HDmemset(heap_id[i], 0, id_len); + if(H5HF_insert(fh, dxpl, (sizeof(obj1)), &obj1, heap_id[i]) < 0) + FAIL_STACK_ERROR + } /* end for */ + + /* Close the fractal heap */ + if(H5HF_close(fh, dxpl) < 0) + TEST_ERROR + + /* Close the file */ + if(H5Fclose(file) < 0) + TEST_ERROR + + /* All tests passed */ + PASSED() + + return(0); + +error: + H5E_BEGIN_TRY { + if(fh) + H5HF_close(fh, dxpl); + H5Fclose(file); + } H5E_END_TRY; + return(1); +} /* test_man_incr_insert_remove() */ #endif /* QAK */ #ifndef QAK @@ -15420,7 +15532,7 @@ test_random(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_test_pa /* seed = (unsigned long)1156158635; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); #endif /* QAK */ - HDsrandom(seed); + HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ total_obj_added = 0; @@ -15624,7 +15736,7 @@ test_random_pow2(hsize_t size_limit, hid_t fapl, H5HF_create_t *cparam, fheap_te /* seed = (unsigned long)1155181717; */ HDfprintf(stderr, "Random # seed was: %lu\n", seed); #endif /* QAK */ - HDsrandom(seed); + HDsrandom((unsigned)seed); /* Loop over adding objects to the heap, until the size limit is reached */ total_obj_added = 0; @@ -15838,7 +15950,7 @@ test_write(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_t *tparam) filter_class.set_local = NULL; filter_class.filter = test_write_filter; if(H5Zregister(&filter_class) < 0) TEST_ERROR - if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_RESERVED + 43, 0, 0, NULL) < 0) + if(H5Z_append(&tmp_cparam.pline, H5Z_FILTER_RESERVED + 43, 0, (size_t)0, NULL) < 0) FAIL_STACK_ERROR test_write_filter_called = FALSE; } /* end if */ @@ -16292,6 +16404,7 @@ curr_test = FHEAP_TEST_NORMAL; break; /* An unknown test? */ + case FHEAP_TEST_NTESTS: default: goto error; } /* end switch */ @@ -16340,6 +16453,7 @@ fill = FHEAP_TEST_FILL_LARGE; break; /* An unknown test? */ + case FHEAP_TEST_FILL_N: default: goto error; } /* end switch */ @@ -16348,8 +16462,12 @@ fill = FHEAP_TEST_FILL_LARGE; * Test fractal heap managed object insertion */ +#ifndef QAK /* "Weird" sized objects */ nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam); +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); +#endif /* QAK */ #ifdef ALL_INSERT_TESTS /* "Standard" sized objects, building from simple to complex heaps */ @@ -16411,6 +16529,10 @@ HDfprintf(stderr, "Uncomment tests!\n"); nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); tparam.del_dir = FHEAP_DEL_REVERSE; nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); + + /* Incremental insert & removal */ + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_man_incr_insert_remove(fapl, &small_cparam, &tparam); #else /* QAK */ HDfprintf(stderr, "Uncomment tests!\n"); #endif /* QAK */ @@ -16452,6 +16574,8 @@ tparam.drain_half = FHEAP_DEL_DRAIN_ALL; nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam); } /* end else */ +#else /* QAK */ +HDfprintf(stderr, "Uncomment tests!\n"); #endif /* QAK */ #ifndef QAK -- cgit v0.12 From 88ce565d7d324569f2a360aa37bfeefffa021a8a Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Sun, 1 Apr 2012 22:14:19 -0500 Subject: [svn-r22235] Purpose: Fixed bugs HDFFV-2761 & HDFFV-7852 Description: - Replaced PredType::NotAtexit() with PredType::AtExit(H5CPP_EXITED); and used PredType::AtExit as a flag to detect when all predefined types have been destroyed. Then, H5close will be called to terminate the library after its being re-initiated when the PredType destructors were activated. This change removed the memory leaks shown by the user's sample program. - Added H5CPP_EXITED for PredType::AtExit to use as a flag - Updated some inaccurate comments - Removed stream functions from FileAccPropList - Replaced H5_VMS with appropriate macro in H5IdComponent.cpp - Corrected many URLs (hdfgroup vs. ncsa) in comments - Replaced std::string with H5std_string in comments Platforms tested: Linux/32 2.6 (jam) Linux/64 2.6 (amani) SunOS 5.10 (linew) --- c++/src/H5AtomType.cpp | 8 +++--- c++/src/H5Attribute.cpp | 7 +++-- c++/src/H5CommonFG.cpp | 58 ++++++++++++++++++++--------------------- c++/src/H5DataSet.cpp | 24 ++++++++--------- c++/src/H5DataSpace.cpp | 8 +++--- c++/src/H5DataType.cpp | 44 ++++++++++++++++++++----------- c++/src/H5DcreatProp.cpp | 8 +++--- c++/src/H5DxferProp.cpp | 4 +-- c++/src/H5FaccProp.cpp | 66 ++++++++++------------------------------------- c++/src/H5FcreatProp.cpp | 10 +++---- c++/src/H5File.cpp | 26 +++++++++---------- c++/src/H5Group.cpp | 30 ++++++++++----------- c++/src/H5IdComponent.cpp | 10 ++++--- c++/src/H5Library.cpp | 4 +-- c++/src/H5Object.cpp | 24 +++++++++-------- c++/src/H5PredType.cpp | 8 ++++-- c++/src/H5PredType.h | 17 +++++++++--- c++/src/H5PropList.cpp | 2 +- c++/src/H5StrType.cpp | 4 +-- 19 files changed, 177 insertions(+), 185 deletions(-) diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 773fc5d..975cad6 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -98,7 +98,7 @@ H5T_order_t AtomType::getOrder() const //-------------------------------------------------------------------------- // Function: AtomType::getOrder ///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c std::string for the buffer that +/// It takes a reference to a \c H5std_string for the buffer that /// provide the text description of the returned byte order. /// The text description can be either of the following: /// "Little endian byte ordering (0)"; @@ -178,7 +178,7 @@ size_t AtomType::getPrecision() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetPrecision +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetPrecision // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPrecision( size_t precision ) const @@ -198,7 +198,7 @@ void AtomType::setPrecision( size_t precision ) const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-GetOffset +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-GetOffset // Programmer Binh-Minh Ribler - 2000 // Modification // 12/05/00: due to C API change @@ -225,7 +225,7 @@ int AtomType::getOffset() const ///\exception H5::DataTypeIException ///\par Description /// For information, please see C layer Reference Manuat at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetOffset +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetOffset // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setOffset( size_t offset ) const diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index 84826c4..226ae5c 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -223,11 +223,11 @@ size_t Attribute::getInMemDataSize() const // Close the native type and the datatype of this attribute. if (H5Tclose(native_type) < 0) { - throw DataSetIException(func, "H5Tclose(native_type) failed"); + throw DataSetIException(func, "H5Tclose(native_type) failed"); } if (H5Tclose(mem_type_id) < 0) { - throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); + throw DataSetIException(func, "H5Tclose(mem_type_id) failed"); } // Get number of elements of the attribute by first getting its dataspace @@ -246,7 +246,7 @@ size_t Attribute::getInMemDataSize() const // Close the dataspace if (H5Sclose(space_id) < 0) { - throw DataSetIException(func, "H5Sclose failed"); + throw DataSetIException(func, "H5Sclose failed"); } // Calculate and return the size of the data @@ -469,7 +469,6 @@ void Attribute::p_read_fixed_len(const DataType& mem_type, H5std_string& strg) c //-------------------------------------------------------------------------- void Attribute::p_read_variable_len(const DataType& mem_type, H5std_string& strg) const { - // Prepare and call C API to read attribute. char *strg_C; diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index 5b93bd5..6a8609f 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -31,7 +31,7 @@ #include "H5DataSet.h" #include "H5File.h" #include "H5Alltypes.h" -#include "H5private.h" // for HDstrcpy +#include "H5private.h" // for HDstrcpy // There are a few comments that are common to most of the functions // defined in this file so they are listed here. @@ -101,7 +101,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const // Function: CommonFG::createGroup ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::createGroup( const H5std_string& name, size_t size_hint ) const @@ -139,7 +139,7 @@ Group CommonFG::openGroup( const char* name ) const // Function: CommonFG::openGroup ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group CommonFG::openGroup( const H5std_string& name ) const @@ -183,7 +183,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co // Function: CommonFG::createDataSet ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::createDataSet( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const DSetCreatPropList& create_plist ) const @@ -218,7 +218,7 @@ DataSet CommonFG::openDataSet( const char* name ) const // Function: CommonFG::openDataSet ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataSet CommonFG::openDataSet( const H5std_string& name ) const @@ -275,7 +275,7 @@ void CommonFG::link( H5L_type_t link_type, const char* curr_name, const char* ne // Function: CommonFG::link ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a curr_name and \a new_name. +/// \c H5std_string for \a curr_name and \a new_name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::link( H5L_type_t link_type, const H5std_string& curr_name, const H5std_string& new_name ) const @@ -305,7 +305,7 @@ void CommonFG::unlink( const char* name ) const // Function: CommonFG::unlink ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::unlink( const H5std_string& name ) const @@ -322,8 +322,8 @@ void CommonFG::unlink( const H5std_string& name ) const ///\note /// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with Group::move. Please refer -/// to the Group Interface in the HDF5 User's Guide at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/Groups.html +/// to the Group Interface in the HDF5 User's Guide for details at: +/// http://www.hdfgroup.org/HDF5/doc/UG/UG_frame09Groups.html // Programmer Binh-Minh Ribler - 2000 // Modification // 2007: QAK modified to use H5L APIs - BMR @@ -341,7 +341,7 @@ void CommonFG::move( const char* src, const char* dst ) const // Function: CommonFG::move ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a src and \a dst. +/// \c H5std_string for \a src and \a dst. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const @@ -360,7 +360,7 @@ void CommonFG::move( const H5std_string& src, const H5std_string& dst ) const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5G.html#Group-GetObjinfo +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5G.html#Group-GetObjinfo // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& statbuf ) const @@ -376,7 +376,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st // Function: CommonFG::getObjinfo ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const H5std_string& name, hbool_t follow_link, H5G_stat_t& statbuf ) const @@ -405,7 +405,7 @@ void CommonFG::getObjinfo( const char* name, H5G_stat_t& statbuf ) const // Function: CommonFG::getObjinfo ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Nov, 2005 //-------------------------------------------------------------------------- void CommonFG::getObjinfo( const H5std_string& name, H5G_stat_t& statbuf ) const @@ -462,7 +462,7 @@ H5std_string CommonFG::getLinkval( const char* name, size_t size ) const // Function: CommonFG::getLinkval ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string CommonFG::getLinkval( const H5std_string& name, size_t size ) const @@ -503,7 +503,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const // Function: CommonFG::setComment ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name and \a comment. +/// \c H5std_string for \a name and \a comment. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::setComment( const H5std_string& name, const H5std_string& comment ) const @@ -535,7 +535,7 @@ void CommonFG::removeComment(const char* name) const // Function: CommonFG::removeComment ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - May 2005 //-------------------------------------------------------------------------- void CommonFG::removeComment(const H5std_string& name) const @@ -596,7 +596,7 @@ H5std_string CommonFG::getComment( const char* name, size_t bufsize ) const // Function: CommonFG::getComment ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5std_string CommonFG::getComment( const H5std_string& name, size_t bufsize ) const @@ -633,7 +633,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const // Function: CommonFG::mount ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::mount( const H5std_string& name, H5File& child, PropList& plist ) const @@ -664,7 +664,7 @@ void CommonFG::unmount( const char* name ) const // Function: CommonFG::unmount ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void CommonFG::unmount( const H5std_string& name ) const @@ -699,7 +699,7 @@ DataType CommonFG::openDataType( const char* name ) const // Function: CommonFG::openDataType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType CommonFG::openDataType( const H5std_string& name ) const @@ -734,7 +734,7 @@ ArrayType CommonFG::openArrayType( const char* name ) const // Function: CommonFG::openArrayType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- ArrayType CommonFG::openArrayType( const H5std_string& name ) const @@ -769,7 +769,7 @@ CompType CommonFG::openCompType( const char* name ) const // Function: CommonFG::openCompType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- CompType CommonFG::openCompType( const H5std_string& name ) const @@ -804,7 +804,7 @@ EnumType CommonFG::openEnumType( const char* name ) const // Function: CommonFG::openEnumType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const H5std_string& name ) const @@ -839,7 +839,7 @@ IntType CommonFG::openIntType( const char* name ) const // Function: CommonFG::openIntType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const H5std_string& name ) const @@ -874,7 +874,7 @@ FloatType CommonFG::openFloatType( const char* name ) const // Function: CommonFG::openFloatType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const H5std_string& name ) const @@ -909,7 +909,7 @@ StrType CommonFG::openStrType( const char* name ) const // Function: CommonFG::openStrType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType CommonFG::openStrType( const H5std_string& name ) const @@ -944,7 +944,7 @@ VarLenType CommonFG::openVarLenType( const char* name ) const // Function: CommonFG::openVarLenType ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - Jul, 2005 //-------------------------------------------------------------------------- VarLenType CommonFG::openVarLenType( const H5std_string& name ) const @@ -980,7 +980,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* // Function: CommonFG::iterateElems ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int CommonFG::iterateElems( const H5std_string& name, int *idx, H5G_iterate_t op , void* op_data ) @@ -1073,7 +1073,7 @@ ssize_t CommonFG::getObjnameByIdx(hsize_t idx, char* name, size_t size) const // Function: CommonFG::getObjnameByIdx ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes an -/// \c std::string for \a name. +/// \c H5std_string for \a name. // Programmer Binh-Minh Ribler - January, 2003 //-------------------------------------------------------------------------- ssize_t CommonFG::getObjnameByIdx(hsize_t idx, H5std_string& name, size_t size) const diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index f73be0f..f7aaa72 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -429,7 +429,7 @@ void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_sp //-------------------------------------------------------------------------- // Function: DataSet::read ///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c std::string for the buffer. +/// It takes a reference to a \c H5std_string for the buffer. ///\param buf - IN: Buffer for read data ///\param mem_type - IN: Memory datatype ///\param mem_space - IN: Memory dataspace @@ -505,7 +505,7 @@ void DataSet::write( const void* buf, const DataType& mem_type, const DataSpace& //-------------------------------------------------------------------------- // Function: DataSet::write ///\brief This is an overloaded member function, provided for convenience. -/// It takes a reference to a \c std::string for the buffer. +/// It takes a reference to a \c H5std_string for the buffer. // Programmer Binh-Minh Ribler - 2000 // Modification // Jul 2009 @@ -589,7 +589,7 @@ int DataSet::iterateElems( void* buf, const DataType& type, const DataSpace& spa /// For more information, please see the Description section in /// C layer Reference Manual at: ///\par -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5D.html#Dataset-Extend +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5D.html#Dataset-Extend // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::extend( const hsize_t* size ) const @@ -649,14 +649,14 @@ void DataSet::fillMemBuf(void *buf, DataType& buf_type, DataSpace& space) // Function: DataSet::getObjType ///\brief Retrieves the type of object that an object reference points to. ///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT \tReference is an object reference. -/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference. +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. ///\param ref - IN: Reference to query ///\return An object type, which can be one of the following: -/// \li \c H5G_LINK (0) \tObject is a symbolic link. -/// \li \c H5G_GROUP (1) \tObject is a group. -/// \li \c H5G_DATASET (2) \tObject is a dataset. -/// \li \c H5G_TYPE Object (3) \tis a named datatype +/// \li \c H5G_LINK (0) - Object is a symbolic link. +/// \li \c H5G_GROUP (1) - Object is a group. +/// \li \c H5G_DATASET (2) - Object is a dataset. +/// \li \c H5G_TYPE (3) - Object is a named datatype ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -674,9 +674,9 @@ H5G_obj_t DataSet::getObjType(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- // Function: DataSet::getRegion ///\brief Retrieves a dataspace with the region pointed to selected. +///\param ref - IN: Reference to get region of ///\param ref_type - IN: Type of reference to get region of - default /// to H5R_DATASET_REGION -///\param ref - IN: Reference to get region of ///\return DataSpace instance ///\exception H5::DataSetIException // Programmer Binh-Minh Ribler - May, 2004 @@ -694,7 +694,7 @@ DataSpace DataSet::getRegion(void *ref, H5R_type_t ref_type) const //-------------------------------------------------------------------------- // Function: DataSet::getId -// Purpose: Get the id of this attribute +///\brief Get the id of this dataset. // Description: // Class hierarchy is revised to address bugzilla 1068. Class // AbstractDs and Attribute are moved out of H5Object. In @@ -776,7 +776,7 @@ void DataSet::p_read_variable_len(const hid_t mem_type_id, const hid_t mem_space //-------------------------------------------------------------------------- // Function: DataSet::p_setId (private) -///\brief Sets the identifier of this object to a new value. +///\brief Sets the identifier of this dataset to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 /// object fails diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index 2c6fd37..755ca5b 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -408,7 +408,7 @@ hssize_t DataSpace::getSelectElemNpoints () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElemPointList +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElemPointList // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, hsize_t *buf ) const @@ -432,7 +432,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectBounds +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectBounds // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const @@ -458,7 +458,7 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElements +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectElements // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord) const @@ -540,7 +540,7 @@ bool DataSpace::selectValid () const ///\par Description /// For more information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index e13b330..3edb163 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -52,16 +52,14 @@ namespace H5 { // Function: DataType overloaded constructor ///\brief Creates a datatype using an existing datatype's id ///\param existing_id - IN: Id of the existing datatype -///\param predefined - IN: Indicates whether or not this datatype is -/// a predefined datatype; default to \c false // Description // Constructor creates a copy of an existing DataType using -// its id. The argument "predefined" is default to false; -// when a default datatype is created, this argument is set -// to true so H5Tclose will not be called on it later. - need -// a reassessment after changing to the new ref counting mech. -// - BMR 5/2004 +// its id. // Programmer Binh-Minh Ribler - 2000 +// Modification +// Dec, 2005 +// Removed second argument, "predefined", after changing to the +// new ref counting mechanism that relies on C's ref counting. //-------------------------------------------------------------------------- DataType::DataType(const hid_t existing_id) : H5Object() { @@ -210,7 +208,7 @@ void DataType::copy( const DataType& like_type ) ///\param dset - IN: Dataset ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - Jan, 2007 -///\parDescription +///\par Description /// The resulted dataset will be transient and modifiable. //-------------------------------------------------------------------------- void DataType::copy(const DataSet& dset) @@ -517,7 +515,7 @@ DataType DataType::getSuper() const ///\exception H5::DataTypeIException ///\par Description /// For more information, please see: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-Register +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-Register // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const @@ -794,17 +792,33 @@ void DataType::close() // Programmer Binh-Minh Ribler - 2000 // Modification // - Replaced resetIdComponent() with decRefCount() to use C -// library ID reference counting mechanism - BMR, Jun 1, 2004 +// library ID reference counting mechanism - BMR, Jun 1, 2004 // - Replaced decRefCount with close() to let the C library -// handle the reference counting - BMR, Jun 1, 2006 +// handle the reference counting - BMR, Jun 1, 2006 +// - Added the use of H5CPP_EXITED to terminate the HDF5 library +// and elimiate previous memory leaks. See comments in the +// header file "H5PredType.h" for details. - BMR, Mar 30, 2012 //-------------------------------------------------------------------------- DataType::~DataType() { - try { - close(); - } catch (Exception close_error) { - cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; + try + { + /* If this is the object AtExit, terminate the HDF5 library. This is + to eliminate memory leaks due to the library being re-initiated + (after the program has ended) and not re-terminated. */ + if (id == H5CPP_EXITED) + { + herr_t ret_value = H5close(); + if (ret_value == FAIL) + throw DataTypeIException(inMemFunc("~DataType - "), "H5close failed"); } + // Close the HDF5 datatype + else + close(); + } + catch (Exception close_error) { + cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; + } } #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index 981085d..ece435c 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -106,8 +106,8 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const ///\param layout - IN: Type of storage layout for raw data ///\exception H5::PropListIException ///\par Description -/// For information on setting layout type, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetLayout +/// For information on valid layout types, please refer to +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetLayout // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setLayout(H5D_layout_t layout) const @@ -211,7 +211,7 @@ void DSetCreatPropList::setSzip(unsigned int options_mask, unsigned int pixels_p ///\par /// For information on setting fill value, please refer to the /// C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFillValue +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFillValue // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* value ) const @@ -459,7 +459,7 @@ bool DSetCreatPropList::allFiltersAvail() ///\par Description /// Please refer to the Reference Manual of \c H5Pset_shuffle for /// details. -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetShuffle // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DSetCreatPropList::setShuffle() const diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 0f7faa2..0785735 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -309,7 +309,7 @@ void DSetMemXferPropList::getMulti(hid_t *memb_dxpl) ///\exception H5::PropListIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSmallData +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSmallData // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setSmallDataBlockSize(hsize_t size) @@ -349,7 +349,7 @@ hsize_t DSetMemXferPropList::getSmallDataBlockSize() ///\par Description /// For information, please refer to the C layer Reference /// Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetHyperVectorSize +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetHyperVectorSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index f2ab0f3..4fb3836 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -76,7 +76,7 @@ void FileAccPropList::setStdio() const /// driver was set for the property list. The driver ID is /// only valid as long as the file driver remains registered. /// Valid driver identifiers can be found at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetDriver ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -99,7 +99,7 @@ hid_t FileAccPropList::getDriver() const ///\par Description /// For a list of valid driver identifiers, please see the C /// layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetDriver // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setDriver(hid_t new_driver_id, const void *new_driver_info) const @@ -157,7 +157,7 @@ hsize_t FileAccPropList::getFamilyOffset() const ///\par Description /// For more details on the use of \c H5FD_CORE driver, please /// refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplCore // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const @@ -261,7 +261,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const ///\exception H5::PropListIException ///\par Description /// Temporary - For information, please refer to: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplSplit +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplSplit // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext, const char* raw_ext ) const @@ -292,47 +292,9 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra setSplit( meta_plist, raw_plist, meta_ext.c_str(), raw_ext.c_str() ); } -#ifdef H5_HAVE_STREAM // for Stream Virtual File Driver -//-------------------------------------------------------------------------- -// Function: FileAccPropList::getStream -///\brief Retrieves the streaming I/O driver settings -///\return The streaming I/O file access property list structure -/// For detail on this structure, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream -///\exception H5::PropListIException -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -H5FD_stream_fapl_t FileAccPropList::getStream() const -{ - H5FD_stream_fapl_t fapl; - herr_t ret_value = H5Pget_fapl_stream(id, &fapl); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::getStream", "H5Pget_fapl_stream failed"); - } - return(fapl); -} - -//-------------------------------------------------------------------------- -// Function: FileAccPropList::setStream -///\brief Modifies this file access property list to use the Stream -/// driver. -///\param fapl - IN: The streaming I/O file access property list -///\exception H5::PropListIException -///\par Description -/// For detail on \a fapl, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream -// Programmer: Binh-Minh Ribler - April, 2004 -//-------------------------------------------------------------------------- -void FileAccPropList::setStream(H5FD_stream_fapl_t &fapl) const -{ - herr_t ret_value = H5Pset_fapl_stream (id, &fapl); - if( ret_value < 0 ) - { - throw PropListIException("FileAccPropList::setStream", "H5Pset_fapl_stream failed"); - } -} -#endif // Stream Virtual File Driver +// Stream Virtual File Driver had been removed from the main library. +// FileAccPropList::[s,g]etStream are now removed from the C++ API. +// -BMR, March, 2012 //-------------------------------------------------------------------------- // Function: FileAccPropList::getSieveBufSize @@ -360,7 +322,7 @@ size_t FileAccPropList::getSieveBufSize() const ///\exception H5::PropListIException ///\par Description /// For detail on data sieving, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSieveBufSize +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSieveBufSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setSieveBufSize(size_t bufsize) const @@ -380,7 +342,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const ///\exception H5::PropListIException ///\par Description /// For more detail, please see the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMetaBlockSize +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMetaBlockSize // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const @@ -420,7 +382,7 @@ hsize_t FileAccPropList::getMetaBlockSize() const ///\exception H5::PropListIException ///\par Description /// For detail on \a flags, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetFaplLog // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setLog(const char *logfile, unsigned flags, size_t buf_size) const @@ -477,7 +439,7 @@ void FileAccPropList::setSec2() const /// The parameter \a alignment must have a positive value. /// /// For detail on \a setting alignment, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetAlignment +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetAlignment // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const @@ -514,7 +476,7 @@ void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) con ///\exception H5::PropListIException ///\par Description /// More details and valid values for \a dtype can be found at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMultiType +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void FileAccPropList::setMultiType(H5FD_mem_t dtype) const @@ -533,7 +495,7 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const ///\exception H5::PropListIException ///\par Description /// More details and possible returned values can be found at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetMultiType +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetMultiType // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- H5FD_mem_t FileAccPropList::getMultiType() const @@ -634,7 +596,7 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() ///\exception H5::PropListIException ///\par Description /// For detail on \a fapl, please refer to -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetGCReferences // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setGcReferences( unsigned gc_ref ) const diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 53d18f6..8d9965e 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -128,7 +128,7 @@ hsize_t FileCreatPropList::getUserblock() const ///\par Description /// For information on setting sizes, please refer to the /// C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSizes +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSizes // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const @@ -168,7 +168,7 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const @@ -189,7 +189,7 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const ///\exception H5::PropListIException ///\par Description /// For information, please see -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetSymK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const @@ -210,7 +210,7 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const ///\exception H5::PropListIException ///\par Description /// For information, please see the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileCreatPropList::setIstorek( unsigned ik ) const @@ -230,7 +230,7 @@ void FileCreatPropList::setIstorek( unsigned ik ) const ///\exception H5::PropListIException ///\par Description /// For information, please see -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-GetIstoreK // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- unsigned FileCreatPropList::getIstorek() const diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index a773489..da0241f 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -76,7 +76,7 @@ H5File::H5File() : IdComponent(), id(0) {} /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer /// Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5F.html#File-Create +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5F.html#File-Create // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& create_plist, const FileAccPropList& access_plist ) : IdComponent(0) @@ -88,7 +88,7 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c // Function: H5File overloaded constructor ///\brief This is another overloaded constructor. It differs from the /// above constructor only in the type of the \a name argument. -///\param name - IN: Name of the file - \c std::string +///\param name - IN: Name of the file - \c H5std_string ///\param flags - IN: File access flags ///\param create_plist - IN: File creation property list, used when /// modifying default file meta-data. Default to @@ -191,8 +191,8 @@ bool H5File::isHdf5(const char* name) //-------------------------------------------------------------------------- // Function: H5File::isHdf5 ///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c std::string for \a name. -///\param name - IN: Name of the file - \c std::string +/// It takes an \c H5std_string for \a name. +///\param name - IN: Name of the file - \c H5std_string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- bool H5File::isHdf5(const H5std_string& name ) @@ -231,8 +231,8 @@ void H5File::openFile(const char* name, unsigned int flags, const FileAccPropLis //-------------------------------------------------------------------------- // Function: H5File::openFile ///\brief This is an overloaded member function, provided for convenience. -/// It takes an \c std::string for \a name. -///\param name - IN: Name of the file - \c std::string +/// It takes an \c H5std_string for \a name. +///\param name - IN: Name of the file - \c H5std_string ///\param flags - IN: File access flags ///\param access_plist - IN: File access property list. Default to /// FileAccPropList::DEFAULT @@ -512,8 +512,8 @@ H5std_string H5File::getFileName() const ///\brief Retrieves the type of object that an object reference points to. ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference, valid values are: -/// \li \c H5R_OBJECT \tReference is an object reference. -/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference. +/// \li \c H5R_OBJECT - Reference is an object reference +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference ///\return Object type, which can be one of the following: /// \li \c H5G_LINK - Object is a symbolic link. /// \li \c H5G_GROUP - Object is a group. @@ -600,9 +600,9 @@ void H5File::p_reference(void* ref, const char* name, hid_t space_id, H5R_type_t ///\param name - IN: Name of the object to be referenced ///\param dataspace - IN: Dataspace with selection ///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT \tReference is an object reference. -/// \li \c H5R_DATASET_REGION \tReference is a dataset region -/// reference. - this is the default +/// \li \c H5R_OBJECT - Reference is an object reference +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference - this is the default ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -643,9 +643,9 @@ void H5File::reference(void* ref, const char* name) const // Function: H5File::reference ///\brief This is an overloaded function, provided for your convenience. /// It differs from the above function in that it takes an -/// \c std::string for the object's name. +/// \c H5std_string for the object's name. ///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced - \c std::string +///\param name - IN: Name of the object to be referenced - \c H5std_string // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5File::reference(void* ref, const H5std_string& name) const diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index afcc7eb..6ec2dbb 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -79,7 +79,7 @@ hid_t Group::getLocId() const //-------------------------------------------------------------------------- // Function: Group overloaded constructor ///\brief Creates a Group object using the id of an existing group. -///\param group_id - IN: Id of an existing group +///\param existing_id - IN: Id of an existing group // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Group::Group(const hid_t existing_id) : H5Object() @@ -153,13 +153,13 @@ Group::Group(Attribute& attr, const void* ref, H5R_type_t ref_type) : H5Object() ///\brief Retrieves the type of object that an object reference points to. ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT \tReference is an object reference. -/// \li \c H5R_DATASET_REGION \tReference is a dataset region reference. +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region reference. ///\return An object type, which can be one of the following: -/// H5G_LINK Object is a symbolic link. -/// H5G_GROUP Object is a group. -/// H5G_DATASET Object is a dataset. -/// H5G_TYPE Object is a named datatype +/// \li \c H5G_LINK (0) - Object is a symbolic link. +/// \li \c H5G_GROUP (1) - Object is a group. +/// \li \c H5G_DATASET (2) - Object is a dataset. +/// \li \c H5G_TYPE (3) - Object is a named datatype ///\exception H5::GroupIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -199,10 +199,10 @@ DataSpace Group::getRegion(void *ref, H5R_type_t ref_type) const // Purpose: Get the id of this attribute // Modification: // May 2008 - BMR -// Class hierarchy is revised to address bugzilla 1068. Class -// AbstractDS and Attribute are moved out of H5Object. In -// addition, member IdComponent::id is moved into subclasses, and -// IdComponent::getId now becomes pure virtual function. +// Class hierarchy is revised to address bugzilla 1068. Class +// AbstractDS and Attribute are moved out of H5Object. In +// addition, member IdComponent::id is moved into subclasses, and +// IdComponent::getId now becomes pure virtual function. // Programmer Binh-Minh Ribler - May, 2008 //-------------------------------------------------------------------------- hid_t Group::getId() const @@ -215,11 +215,11 @@ hid_t Group::getId() const ///\brief Sets the identifier of this object to a new value. /// ///\exception H5::IdComponentException when the attempt to close the HDF5 -/// object fails +/// object fails // Description: -// The underlaying reference counting in the C library ensures -// that the current valid id of this object is properly closed. -// Then the object's id is reset to the new id. +// The underlaying reference counting in the C library ensures +// that the current valid id of this object is properly closed. +// Then the object's id is reset to the new id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Group::p_setId(const hid_t new_id) diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index 1cac0c1..9f96277 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -13,11 +13,13 @@ * access to either file, you may request a copy from help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#ifdef H5_VMS +#ifdef OLD_HEADER_FILENAME +#include +#else #include -#endif /*H5_VMS*/ - +#endif #include + #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -129,7 +131,7 @@ int IdComponent::getCounter() const //-------------------------------------------------------------------------- // Function: hdfObjectType ///\brief Given an id, returns the type of the object. -///return a valid HDF object type, which may be one of the following: +///\return a valid HDF object type, which may be one of the following: /// \li \c H5I_FILE /// \li \c H5I_GROUP /// \li \c H5I_DATATYPE diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index e7557b3..ecc5141 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -106,7 +106,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel ///\par Description /// For information about library version, please refer to /// the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-VersCheck +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-VersCheck // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) @@ -161,7 +161,7 @@ void H5Library::garbageCollect() /// Setting a value of -1 for a limit means no limit of that type. /// For more information on free list limits, please refer to C /// layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5.html#Library-SetFreeListLimits // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index e25c255..3c85502 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -124,7 +124,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type // Function: H5Object::createAttribute ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes -/// a reference to an \c std::string for \a name. +/// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Object::createAttribute( const H5std_string& name, const DataType& data_type, const DataSpace& data_space, const PropList& create_plist ) const @@ -158,7 +158,7 @@ Attribute H5Object::openAttribute( const char* name ) const // Function: H5Object::openAttribute ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes -/// a reference to an \c std::string for \a name. +/// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- Attribute H5Object::openAttribute( const H5std_string& name ) const @@ -194,15 +194,17 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const ///\brief Iterates a user's function over all the attributes of an H5 /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute -///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices +///\param _idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices ///\param op_data - IN: User's data to pass to user's operator function ///\return Returned value of the last operator if it was non-zero, or /// zero if all attributes were processed ///\exception H5::AttributeIException ///\par Description +/// The signature of user_op is +/// void (*)(H5::H5Object&, H5std_string, void*). /// For information, please refer to the C layer Reference Manual /// at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5A.html#Annot-Iterate +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5A.html#Annot-Iterate // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- int H5Object::iterateAttrs( attr_operator_t user_op, unsigned *_idx, void *op_data ) @@ -267,7 +269,7 @@ void H5Object::removeAttr( const char* name ) const // Function: H5Object::removeAttr ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes -/// a reference to an \c std::string for \a name. +/// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Object::removeAttr( const H5std_string& name ) const @@ -294,7 +296,7 @@ void H5Object::renameAttr(const char* oldname, const char* newname) const // Function: H5Object::renameAttr ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes -/// a reference to an \c std::string for the names. +/// a reference to an \c H5std_string for the names. // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- void H5Object::renameAttr(const H5std_string& oldname, const H5std_string& newname) const @@ -366,9 +368,9 @@ void H5Object::p_reference(void* ref, const char* name, hid_t space_id, H5R_type ///\param name - IN: Name of the object to be referenced ///\param dataspace - IN: Dataspace with selection ///\param ref_type - IN: Type of reference to query, valid values are: -/// \li \c H5R_OBJECT \tReference is an object reference. -/// \li \c H5R_DATASET_REGION \tReference is a dataset region -/// reference. - this is the default +/// \li \c H5R_OBJECT - Reference is an object reference. +/// \li \c H5R_DATASET_REGION - Reference is a dataset region +/// reference. - this is the default ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -410,9 +412,9 @@ void H5Object::reference(void* ref, const char* name) const // Function: H5Object::reference ///\brief This is an overloaded function, provided for your convenience. /// It differs from the above function in that it takes an -/// \c std::string for the object's name. +/// \c H5std_string for the object's name. ///\param ref - IN: Reference pointer -///\param name - IN: Name of the object to be referenced - \c std::string +///\param name - IN: Name of the object to be referenced - \c H5std_string // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Object::reference(void* ref, const H5std_string& name) const diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index 347f02f..9dfc760 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -44,7 +44,10 @@ namespace H5 { //-------------------------------------------------------------------------- PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id ) { - id = H5Tcopy(predtype_id); + if (predtype_id == H5CPP_EXITED) + id = predtype_id; + else + id = H5Tcopy(predtype_id); } //-------------------------------------------------------------------------- @@ -62,7 +65,8 @@ PredType::PredType() : AtomType() {} //-------------------------------------------------------------------------- PredType::PredType( const PredType& original ) : AtomType( original ) {} -const PredType PredType::NotAtexit; // only for atexit/global dest. problem +// Flag to terminate HDF5 library in DataType::~DataType +const PredType PredType::AtExit(H5CPP_EXITED); // Definition of pre-defined types const PredType PredType::C_S1( H5T_C_S1 ); diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 69abfcb..9cb1c65 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -26,9 +26,17 @@ namespace H5 { #endif +/* This constant is defined for a workaround to eliminate memory leaks due to + the library being re-initiated when PredType destructors are invoked. A + PredType instant with H5CPP_EXITED as the value of its "id" is constructed + before the other PredType objects are created. At exit, when this special + PredType object is to be destructed, no HDF5 library function will be called + and the library will be terminated. -BMR, Mar 30, 2012 */ +#define H5CPP_EXITED -3 // -3 is less likely to be used elsewhere + class H5_DLLCPP PredType : public AtomType { public: - // Returns this class name + ///\brief Returns this class name virtual H5std_string fromClass () const { return("PredType"); } // Makes a copy of the predefined type and stores the new @@ -229,9 +237,10 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // added this to work around the atexit/global destructor problem - // temporarily - it'll prevent the use of atexit to clean up - static const PredType NotAtexit; // not working yet + // Added this to work around the atexit/global destructor problem. + // It'll help to terminate the library after other PredType instances + // are closed. -BMR, Mar 30, 2012 + static const PredType AtExit; protected: #ifndef DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 550c90d..ceea15f 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -570,7 +570,7 @@ void PropList::setProperty(const H5std_string& name, void* value) const /// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c H5std_string -///\param strg - IN: Value for the property is a \c std::string +///\param strg - IN: Value for the property is a \c H5std_string // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- void PropList::setProperty(const H5std_string& name, H5std_string& strg) const diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index e632c4d..a906b72 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -87,7 +87,7 @@ StrType::StrType( const PredType& pred_type, const size_t& size ) : AtomType() // Function: StrType overloaded constructor ///\brief Creates a string datatype with a specified length ///\param dummy - IN: To simplify calling the previous constructor -// and avoid prototype clash with another constructor +/// and avoid prototype clash with another constructor ///\param size - IN: Length of the new string type ///\exception H5::DataTypeIException ///\par Description @@ -209,7 +209,7 @@ H5T_str_t StrType::getStrpad() const ///\exception H5::DataTypeIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: -/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetStrpad +/// http://www.hdfgroup.org/HDF5/doc/RM/RM_H5T.html#Datatype-SetStrpad // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void StrType::setStrpad( H5T_str_t strpad ) const -- cgit v0.12 From e7edf48b8d7cc5452469d6d6724331282660037e Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 2 Apr 2012 09:39:37 -0500 Subject: [svn-r22236] Description: Switch 'snprintf' -> 'HDsnprintf' Tested on: (eyeballed only, very simple) --- hl/src/H5LT.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index 8136b11..678642f 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -937,7 +937,7 @@ hid_t H5LTopen_file_image(void *buf_ptr, size_t buf_size, unsigned flags) file_open_flags = H5F_ACC_RDONLY; /* define a unique file name */ - snprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); + HDsnprintf(file_name, (sizeof(file_name) - 1), "file_image_%ld", file_name_counter++); /* Assign file image in FAPL to the core file driver */ if ((file_id = H5Fopen(file_name, file_open_flags, fapl)) < 0) -- cgit v0.12 From 41f7a9fb39a015d3ac1b2b0c2153d164f60a7531 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Mon, 2 Apr 2012 10:27:39 -0500 Subject: [svn-r22238] Added comment to explain why FNAME4 is used and cautioned other files may not work. --- tools/h5repack/h5repacktst.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index ae272ab..000e617 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1565,6 +1565,8 @@ int main (void) * test --metadata_block_size option * Also verify that output file using the metadata_block_size option is * larger than the output file one not using it. + * FNAME4 is used because it works for this test. Other files, such as + * FNAME1, fails this test. *------------------------------------------------------------------------- */ TESTING(" metadata block size option"); -- cgit v0.12 From b797818c8ba9625f37058451075986a06391f90c Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 2 Apr 2012 13:26:00 -0500 Subject: [svn-r22240] Description: Update comment about metadata block size test. --- tools/h5repack/h5repacktst.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 000e617..6b15f0a 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1565,8 +1565,8 @@ int main (void) * test --metadata_block_size option * Also verify that output file using the metadata_block_size option is * larger than the output file one not using it. - * FNAME4 is used because it works for this test. Other files, such as - * FNAME1, fails this test. + * FNAME4 is used because it is the same as the test file used for the + * shell script version of this test (h5repack.sh). *------------------------------------------------------------------------- */ TESTING(" metadata block size option"); -- cgit v0.12 From 3c017d7d378e9dc29281dd3c285eafb929159c6d Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Mon, 2 Apr 2012 17:14:50 -0500 Subject: [svn-r22242] Issue 7934 - The data sieve buffer size was for all the datasets in the file. It could waste memory if any dataset size is smaller than the sieve buffer size. Now the library picks the smaller one between the dataset size and the sieve buffer size from the file access property. Tested on jam, koala, and ostrich. --- release_docs/RELEASE.txt | 5 +++++ src/H5Dcontig.c | 13 +++++++++++-- src/H5Dlayout.c | 22 +++++++++++++++++----- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index a4633b0..bb368fb 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -93,6 +93,11 @@ New Features Library: -------- + - The data sieve buffer size was for all the datasets in the file. It + could waste memory if any dataset size is smaller than the sieve buffer + size. Now the library picks the smaller one between the dataset size + and the sieve buffer size from the file access property. See Issue 7934. + (SLU - 2012/4/2) - I added a new parameter of object access property list to the function H5Rdereference (Issue 2763). It's called H5Rdereference2 now. The former H5Rdereference function has been deprecated to H5Rdereference1. (SLU - diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index 674582d..c1ff68c 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -420,6 +420,7 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) hsize_t nelmts; /* Number of elements in dataspace */ size_t dt_size; /* Size of datatype */ hsize_t tmp_size; /* Temporary holder for raw data size */ + size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ hsize_t dim[H5O_LAYOUT_NDIMS]; /* Current size of data in elements */ hsize_t max_dim[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */ int ndims; /* Rank of dataspace */ @@ -464,8 +465,15 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) /* Assign the dataset's contiguous storage size */ dset->shared->layout.storage.u.contig.size = tmp_size; - /* Get the sieve buffer size for this dataset */ - dset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(f); + /* Get the sieve buffer size for the file */ + tmp_sieve_buf_size = H5F_SIEVE_BUF_SIZE(f); + + /* Adjust the sieve buffer size to the smaller one between the dataset size and the buffer size + * from the file access property. (SLU - 2012/3/30) */ + if(tmp_size < tmp_sieve_buf_size) + dset->shared->cache.contig.sieve_buf_size = tmp_size; + else + dset->shared->cache.contig.sieve_buf_size = tmp_sieve_buf_size; done: FUNC_LEAVE_NOAPI(ret_value) @@ -965,6 +973,7 @@ H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, /* Allocate room for the data sieve buffer */ if(NULL == (dset_contig->sieve_buf = H5FL_BLK_MALLOC(sieve_buf, dset_contig->sieve_buf_size))) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "memory allocation failed") + #ifdef H5_CLEAR_MEMORY if(dset_contig->sieve_size > len) HDmemset(dset_contig->sieve_buf + len, 0, (dset_contig->sieve_size - len)); diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 7ec6404..53d49aa 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -384,6 +384,10 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t switch(dataset->shared->layout.type) { case H5D_CONTIGUOUS: + { + hsize_t tmp_size; /* Temporary holder for raw data size */ + size_t tmp_sieve_buf_size; /* Temporary holder for sieve buffer size */ + /* Compute the size of the contiguous storage for versions of the * layout message less than version 3 because versions 1 & 2 would * truncate the dimension sizes to 32-bits of information. - QAK 5/26/04 @@ -392,7 +396,6 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ hsize_t nelmts; /* Number of elements in dataspace */ size_t dt_size; /* Size of datatype */ - hsize_t tmp_size; /* Temporary holder for raw data size */ /* Retrieve the number of elements in the dataspace */ if((snelmts = H5S_GET_EXTENT_NPOINTS(dataset->shared->space)) < 0) @@ -412,10 +415,19 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t /* Assign the dataset's contiguous storage size */ dataset->shared->layout.storage.u.contig.size = tmp_size; - } /* end if */ - - /* Get the sieve buffer size for this dataset */ - dataset->shared->cache.contig.sieve_buf_size = H5F_SIEVE_BUF_SIZE(dataset->oloc.file); + } else + tmp_size = dataset->shared->layout.storage.u.contig.size; + + /* Get the sieve buffer size for the file */ + tmp_sieve_buf_size = H5F_SIEVE_BUF_SIZE(dataset->oloc.file); + + /* Adjust the sieve buffer size to the smaller one between the dataset size and the buffer size + * from the file access property. (SLU - 2012/3/30) */ + if(tmp_size < tmp_sieve_buf_size) + dataset->shared->cache.contig.sieve_buf_size = tmp_size; + else + dataset->shared->cache.contig.sieve_buf_size = tmp_sieve_buf_size; + } break; case H5D_CHUNKED: -- cgit v0.12 From 2c75e81cde93cf0aaea839978ae6dd8538915fa7 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Mon, 2 Apr 2012 23:13:30 -0500 Subject: [svn-r22243] Updated the comments for robodoc inclusion and changed spacing formatting in the source headers, cosmetic changes only. --- fortran/src/H5Off.f90 | 137 +++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 69 deletions(-) diff --git a/fortran/src/H5Off.f90 b/fortran/src/H5Off.f90 index 04c96e2..4f1ea18 100644 --- a/fortran/src/H5Off.f90 +++ b/fortran/src/H5Off.f90 @@ -49,33 +49,32 @@ CONTAINS ! ! PURPOSE ! Creates a hard link to an object in an HDF5 file. -! INPUTS +! +! Inputs: ! object_id - Object to be linked. ! new_loc_id - File or group identifier specifying location at which object is to be linked. ! new_link_name - Name of link to be created, relative to new_loc_id. -! OUTPUTS -! hdferr: - error code -! Success: 0 -! Failure: -1 -! OPTIONAL PARAMETERS +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: ! lcpl_id - Link creation property list identifier. ! lapl_id - Link access property list identifier. +! ! AUTHOR ! M. Scot Breitenfeld ! April 21, 2008 ! -! SOURCE +! Fortran90 Interface: SUBROUTINE h5olink_f(object_id, new_loc_id, new_link_name, hdferr, lcpl_id, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id ! Object to be linked - INTEGER(HID_T), INTENT(IN) :: new_loc_id ! File or group identifier specifying - ! location at which object is to be linked. - CHARACTER(LEN=*), INTENT(IN) :: new_link_name ! Name of link to be created, relative to new_loc_id. - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lcpl_id ! Link creation property list identifier. - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Link creation property list identifier. + INTEGER(HID_T) , INTENT(IN) :: object_id + INTEGER(HID_T) , INTENT(IN) :: new_loc_id + CHARACTER(LEN=*), INTENT(IN) :: new_link_name + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id !***** INTEGER(HID_T) :: lapl_id_default INTEGER(HID_T) :: lcpl_id_default @@ -115,33 +114,33 @@ CONTAINS ! ! NAME ! h5oopen_f +! ! PURPOSE ! Opens an object in an HDF5 file by location identifier and path name. ! -! INPUTS -! loc_id - File or group identifier +! Inputs: +! loc_id - File or group identifier. ! name - Path to the object, relative to loc_id. -! OUTPUTS -! obj_id - Object identifier for the opened object -! hdferr: - error code -! Success: 0 -! Failure: -1 -! OPTIONAL PARAMETERS -! lapl_id - Access property list identifier for the link pointing to the object +! +! Outputs: +! obj_id - Object identifier for the opened object. +! hdferr - Returns 0 if successful and -1 if fails. +! +! Optional parameters: +! lapl_id - Access property list identifier for the link pointing to the object. ! ! AUTHOR ! M. Scot Breitenfeld ! April 18, 2008 -! SOURCE +! +! Fortran90 Interface: SUBROUTINE h5oopen_f(loc_id, name, obj_id, hdferr, lapl_id) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - CHARACTER(LEN=*), INTENT(IN) :: name ! Path to the object, relative to loc_id - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object - INTEGER, INTENT(OUT) :: hdferr ! Error code - ! Success: 0 - ! Failure: -1 - INTEGER(HID_T), OPTIONAL, INTENT(IN) :: lapl_id ! Attribute access property list + INTEGER(HID_T) , INTENT(IN) :: loc_id + CHARACTER(LEN=*), INTENT(IN) :: name + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lapl_id !***** INTEGER(HID_T) :: lapl_id_default INTEGER(SIZE_T) :: namelen @@ -178,20 +177,21 @@ CONTAINS ! PURPOSE ! Closes an object in an HDF5 file. ! -! INPUTS -! object_id - Object identifier -! OUTPUTS -! hdferr - Returns 0 if successful and -1 if fails +! Inputs: +! object_id - Object identifier. +! +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld ! December 17, 2008 ! -! SOURCE +! Fortran90 Interface: SUBROUTINE h5oclose_f(object_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: object_id - INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T), INTENT(IN) :: object_id + INTEGER , INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5oclose_c(object_id) @@ -214,25 +214,25 @@ CONTAINS ! PURPOSE ! Opens an object using its address within an HDF5 file. ! -! INPUTS -! loc_id - File or group identifier -! addr - Object’s address in the file -! OUTPUTS: -! obj_id - Object identifier for the opened object -! hdferr - Returns 0 if successful and -1 if fails +! Inputs: +! loc_id - File or group identifier. +! addr - Object’s address in the file. +! +! Outputs: +! obj_id - Object identifier for the opened object. +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld ! September 14, 2009 ! -! SOURCE +! Fortran90 Interface: SUBROUTINE h5oopen_by_addr_f(loc_id, addr, obj_id, hdferr) IMPLICIT NONE - INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier - INTEGER(HADDR_T), INTENT(IN) :: addr ! Object’s address in the file - INTEGER(HID_T), INTENT(OUT) :: obj_id ! Object identifier for the opened object - INTEGER, INTENT(OUT) :: hdferr ! Error code: - ! 0 on success and -1 on failure + INTEGER(HID_T) , INTENT(IN) :: loc_id + INTEGER(HADDR_T), INTENT(IN) :: addr + INTEGER(HID_T) , INTENT(OUT) :: obj_id + INTEGER , INTENT(OUT) :: hdferr !***** INTERFACE INTEGER FUNCTION h5oopen_by_addr_c(loc_id, addr, obj_id) @@ -249,7 +249,6 @@ CONTAINS hdferr = h5oopen_by_addr_c(loc_id, addr, obj_id) END SUBROUTINE h5oopen_by_addr_f - ! !****s* H5O/h5ocopy_f ! NAME @@ -258,31 +257,31 @@ CONTAINS ! PURPOSE ! Copies an object in an HDF5 file. ! -! INPUTS -! src_loc_id - Object identifier indicating the location of the source object to be copied -! src_name - Name of the source object to be copied -! dst_loc_id - Location identifier specifying the destination -! dst_name - Name to be assigned to the new copy +! Inputs: +! src_loc_id - Object identifier indicating the location of the source object to be copied. +! src_name - Name of the source object to be copied. +! dst_loc_id - Location identifier specifying the destination. +! dst_name - Name to be assigned to the new copy. ! -! OPTIONAL PARAMETERS -! ocpypl_id - Object copy property list -! lcpl_id - Link creation property list for the new hard link +! Optional parameters: +! ocpypl_id - Object copy property list. +! lcpl_id - Link creation property list for the new hard link. ! -! OUTPUTS: -! hdferr - Returns 0 if successful and -1 if fails +! Outputs: +! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR ! M. Scot Breitenfeld ! March 14, 2012 ! -! SOURCE +! Fortran90 Interface: SUBROUTINE h5ocopy_f(src_loc_id, src_name, dst_loc_id, dst_name, hdferr, ocpypl_id, lcpl_id) IMPLICIT NONE - INTEGER(HID_T) , INTENT(IN) :: src_loc_id - CHARACTER(LEN=*), INTENT(IN) :: src_name - INTEGER(HID_T) , INTENT(IN) :: dst_loc_id - CHARACTER(LEN=*), INTENT(IN) :: dst_name - INTEGER, INTENT(OUT) :: hdferr + INTEGER(HID_T) , INTENT(IN) :: src_loc_id + CHARACTER(LEN=*), INTENT(IN) :: src_name + INTEGER(HID_T) , INTENT(IN) :: dst_loc_id + CHARACTER(LEN=*), INTENT(IN) :: dst_name + INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN), OPTIONAL :: ocpypl_id INTEGER(HID_T) , INTENT(IN), OPTIONAL :: lcpl_id !***** -- cgit v0.12 From 2bd76c2d86f5b048ffaf356f047312c241ce733d Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Tue, 3 Apr 2012 16:42:18 -0500 Subject: [svn-r22244] Description: Correct use of deprecated API routines in test routine. Tested on: FreeBSD/32 8.2 (loyalty) w/gcc4.6, w/C++ & FORTRAN, in debug mode FreeBSD/64 8.2 (freedom) w/gcc4.6, w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (koala) 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, w/threadsafe, in production mode Linux/PPC 2.6 (ostrich) w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-ia64 2.6 (ember) w/Intel compilers, w/C++ & FORTRAN, in production mode Mac OS X/32 10.6.8 (amazon) in debug mode Mac OS X/32 10.6.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode --- testpar/t_file_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testpar/t_file_image.c b/testpar/t_file_image.c index d265957..544ba32 100644 --- a/testpar/t_file_image.c +++ b/testpar/t_file_image.c @@ -209,7 +209,7 @@ file_image_daisy_chain_test(void) file_id = H5Fopen(file_name, H5F_ACC_RDWR, fapl_id); VRFY((file_id >= 0), "opened received file image file"); - dset_id = H5Dopen1(file_id, "v"); + dset_id = H5Dopen2(file_id, "v", H5P_DEFAULT); VRFY((dset_id >= 0), "opened data set"); dset_type_id = H5Dget_type(dset_id); @@ -290,10 +290,10 @@ file_image_daisy_chain_test(void) VRFY((err >= 0), "set file image in fapl."); file_id = H5Fopen(file_name, H5F_ACC_RDWR, fapl_id); - H5Eprint1(stderr); + H5Eprint2(H5P_DEFAULT, stderr); VRFY((file_id >= 0), "opened received file image file"); - dset_id = H5Dopen1(file_id, "v"); + dset_id = H5Dopen2(file_id, "v", H5P_DEFAULT); VRFY((dset_id >= 0), "opened data set"); dset_type_id = H5Dget_type(dset_id); -- cgit v0.12 From 1a4865d8feb0ba32c409366bead5f16e3227d596 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 3 Apr 2012 23:02:17 -0500 Subject: [svn-r22246] Changed code comments for h5ltpath_valid_f --- hl/fortran/src/H5LTff.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hl/fortran/src/H5LTff.f90 b/hl/fortran/src/H5LTff.f90 index b384821..0302b61 100644 --- a/hl/fortran/src/H5LTff.f90 +++ b/hl/fortran/src/H5LTff.f90 @@ -6339,7 +6339,7 @@ CONTAINS !DEC$attributes dllexport :: h5ltpath_valid_f !DEC$endif ! - INTEGER(hid_t) , INTENT(IN) :: loc_id ! File or group identifier. + INTEGER(hid_t) , INTENT(IN) :: loc_id ! An identifier of an object in the file. CHARACTER(LEN=*), INTENT(IN) :: path ! Path to the object to check, relative to loc_id. LOGICAL , INTENT(IN) :: check_object_valid ! Indicates whether to check if the final component ! of the path resolves to a valid object -- cgit v0.12 From fad31396844febb86b01271c2503f42023bcf14a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 4 Apr 2012 13:01:29 -0500 Subject: [svn-r22247] Added new files and tests to CMakeLists.txt Tested: local linux --- test/CMakeLists.txt | 3 ++ testpar/CMakeLists.txt | 1 + tools/h5repack/CMakeLists.txt | 70 ++++++++++++++++++++++++++++++++++++++----- 3 files changed, 67 insertions(+), 7 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a2577b9..a6ff10b 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -87,6 +87,7 @@ SET (HDF5_REFERENCE_TEST_FILES family_v16_00003.h5 filespace_1_6.h5 filespace_1_8.h5 + file_image_core_test.h5 fill_old.h5 filter_error.h5 group_old.h5 @@ -307,6 +308,7 @@ SET (H5_TESTS tcheck_version testmeta #links_env + file_image ) FOREACH (test ${H5_TESTS}) @@ -630,6 +632,7 @@ IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS) gen_filespace gen_specmetaread gen_sizes_lheap + gen_file_image ) FOREACH (gen ${H5_GENERATORS}) diff --git a/testpar/CMakeLists.txt b/testpar/CMakeLists.txt index d60aea5..f42af9f 100644 --- a/testpar/CMakeLists.txt +++ b/testpar/CMakeLists.txt @@ -11,6 +11,7 @@ SET (testphdf5_SRCS ${HDF5_TEST_PAR_SOURCE_DIR}/testphdf5.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_dset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_file.c + ${HDF5_TEST_PAR_SOURCE_DIR}/t_file_image.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_mdset.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_ph5basic.c ${HDF5_TEST_PAR_SOURCE_DIR}/t_coll_chunk.c diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 6460375..ae7a658 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -145,6 +145,31 @@ IF (BUILD_TESTING) ############################################################################## ############################################################################## + MACRO (ADD_H5_TEST_OLD testname testtype testfile) + IF (${testtype} STREQUAL "SKIP") + IF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ADD_TEST ( + NAME H5REPACK-${testname}-SKIPPED + COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile}" + ) + ENDIF (NOT HDF5_ENABLE_USING_MEMCHECKER) + ELSE (${testtype} STREQUAL "SKIP") + ADD_TEST ( + NAME H5REPACK-${testname} + COMMAND $ ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK-DIFF_${testname} + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out.${testfile} + ) + SET_TESTS_PROPERTIES (H5REPACK-DIFF_${testname} PROPERTIES DEPENDS H5REPACK-${testname}) + SET (last_test "H5REPACK-DIFF_${testname}") + ENDIF (${testtype} STREQUAL "SKIP") + ENDMACRO (ADD_H5_TEST_OLD) + MACRO (ADD_H5_TEST testname testtype testfile) IF (${testtype} STREQUAL "SKIP") IF (NOT HDF5_ENABLE_USING_MEMCHECKER) @@ -261,6 +286,29 @@ IF (BUILD_TESTING) ENDIF (${testtype} STREQUAL "SKIP") ENDMACRO (ADD_H5_VERIFY_TEST) + MACRO (ADD_H5_TEST_META testname testfile) + ADD_TEST ( + NAME H5REPACK-${testname}_N + COMMAND $ ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-${testname}_N PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST ( + NAME H5REPACK-${testname}_M + COMMAND $ ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5 + ) + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-${testname}_M PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + ADD_TEST (NAME H5REPACK-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out_M.${testname}.h5) + SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES WILL_FAIL "true") + IF (NOT "${last_test}" STREQUAL "") + SET_TESTS_PROPERTIES (H5REPACK-${testname} PROPERTIES DEPENDS ${last_test}) + ENDIF (NOT "${last_test}" STREQUAL "") + SET (last_test "H5REPACK-${testname}") + ENDMACRO (ADD_H5_TEST_META) + ############################################################################## ############################################################################## ### T H E T E S T S ### @@ -278,8 +326,10 @@ IF (BUILD_TESTING) ./testfiles/h5repack_layout2.h5-v.out.err ./testfiles/h5repack_layout.h5-v.out ./testfiles/h5repack_layout.h5-v.out.err + ./testfiles/out.tfamily%05d.h5 ./testfiles/out.h5diff_attr1.h5 ./testfiles/out.h5repack_attr.h5 + ./testfiles/out.h5repack_attr_refs.h5 ./testfiles/out.h5repack_deflate.h5 ./testfiles/out.h5repack_early.h5 ./testfiles/out.h5repack_fill.h5 @@ -295,6 +345,10 @@ IF (BUILD_TESTING) ./testfiles/out.h5repack_refs.h5 ./testfiles/out.h5repack_shuffle.h5 ./testfiles/out.h5repack_soffset.h5 + ./testfiles/out_M.meta_short.h5 + ./testfiles/out_N.meta_short.h5 + ./testfiles/out_M.meta_long.h5 + ./testfiles/out_N.meta_long.h5 # from the h5repacktst h5repack_attr.h5 h5repack_attr_out.h5 @@ -762,7 +816,7 @@ IF (BUILD_TESTING) IF (NOT USE_FILTER_DEFLATE) SET (TESTTYPE "SKIP") ENDIF (NOT USE_FILTER_DEFLATE) -# ADD_H5_TEST (old_style_layout_short_switches ${TESTTYPE} ${arg}) + ADD_H5_TEST_OLD (old_style_layout_short_switches ${TESTTYPE} ${arg}) # add a userblock to file SET (arg ${FILE1} -u ${PROJECT_BINARY_DIR}/testfiles/ublock.bin -b 2048) @@ -783,16 +837,14 @@ IF (BUILD_TESTING) ADD_H5_TEST (committed_dt "TEST" ${FILE15}) # tests family driver (file is located in common testfiles folder, uses TOOLTEST1 -# ADD_H5_TEST ( family "FAMILY" ${FILE16}) + ADD_H5_TEST (family "TEST" ${FILE16}) # test various references (bug 1814 and 1726) ADD_H5_TEST (bug1814 "TEST" ${FILE_REF}) -# test attribute with various references in attribute of compund -# or vlen datatype -# (HDFFV-2605, 7513) -# TODO: include this test when code portion is completed. - ADD_H5_TEST (HDFFV-2605 "SKIP" ${FILE_ATTR_REF}) +# test attribute with various references (bug1797 / HDFFV-5932) +# the references in attribute of compund or vlen datatype + ADD_H5_TEST (HDFFV-5932 "TEST" ${FILE_ATTR_REF}) # Add test for memory leak in attirbute. This test is verified by CTEST. # 1. leak from vlen string @@ -801,6 +853,10 @@ IF (BUILD_TESTING) # Note: this test is experimental for sharing test file among tools ADD_H5_TEST (HDFFV-7840 "TEST" h5diff_attr1.h5) +# tests for metadata block size option ('-M') + ADD_H5_TEST_META (meta_short h5repack_layout.h5 -M 8192) + ADD_H5_TEST_META (meta_long h5repack_layout.h5 --metadata_block_size=8192) + IF (HDF5_TEST_VFD) # Run test with different Virtual File Driver FOREACH (vfd ${VFD_LIST}) -- cgit v0.12 From e6d35a86f379d51292e8218cc2f84f0227691210 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 8 Apr 2012 09:40:16 -0500 Subject: [svn-r22257] Snapshot version 1.9 release 113 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.txt b/README.txt index cb4a1c5..df15871 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.113 currently under development +HDF5 version 1.9.114 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 3f99980..395c76c 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index c492a0c..316d0c9 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 6280eaf..1ef6534 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id: configure.in 22149 2012-03-26 20:26:06Z mamcgree . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.113. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.114. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.113' -PACKAGE_STRING='HDF5 1.9.113' +PACKAGE_VERSION='1.9.114' +PACKAGE_STRING='HDF5 1.9.114' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.113 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.114 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.113:";; + short | recursive ) echo "Configuration of HDF5 1.9.114:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.113 +HDF5 configure 1.9.114 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.113, which was +It was created by HDF5 $as_me 1.9.114, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.113' + VERSION='1.9.114' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.113, which was +This file was extended by HDF5 $as_me 1.9.114, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.113 +HDF5 config.status 1.9.114 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.113 +HDF5 config.lt 1.9.114 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index b53d57c..5459013 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.113], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.114], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c963c83..875f6f7 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index af3203d..9efbd24 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index e9ec78f..afefdc7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 4519dc8..f4875bd 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bb368fb..8761fb9 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.113 currently under development +HDF5 version 1.9.114 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 0f9edfb..e36c0eb 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 113 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 114 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.113" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.114" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 53c06c5..37dc102 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 103 +LT_VERS_REVISION = 104 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index e38f4df..ba723f4 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.113" +#define H5_PACKAGE_STRING "HDF5 1.9.114" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.113" +#define H5_PACKAGE_VERSION "1.9.114" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.113" +#define H5_VERSION "1.9.114" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index f7366ee..a37c206 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.113" +#define H5_PACKAGE_STRING "HDF5 1.9.114" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.113" +#define H5_PACKAGE_VERSION "1.9.114" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.113" +#define H5_VERSION "1.9.114" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 09fa6e9c54380362f6f283ad60daef679ec91b25 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 9 Apr 2012 12:25:17 -0500 Subject: [svn-r22263] Use correct index for inserting null terminator Tested: windows under debug --- test/file_image.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/test/file_image.c b/test/file_image.c index 7c2c3ff..a846a3c 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -108,7 +108,7 @@ test_properties(void) buffer = (char *)HDmalloc(size); for(i = 0; i < count - 1; i++) buffer[i] = (char)(65 + i); - buffer[count] = '\0'; + buffer[count - 1] = '\0'; /* Create fapl */ if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR @@ -324,7 +324,7 @@ static int test_callbacks(void) { H5FD_file_image_callbacks_t real_callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, - &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; H5FD_file_image_callbacks_t null_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; H5FD_file_image_callbacks_t callbacks; hid_t fapl_1; @@ -351,7 +351,7 @@ test_callbacks(void) file_image = (char *)HDmalloc(size); for(i = 0; i < count - 1; i++) file_image[i] = (char)(65 + i); - file_image[count] = '\0'; + file_image[count - 1] = '\0'; /* Create fapl */ if((fapl_1 = H5Pcreate(H5P_FILE_ACCESS)) < 0) FAIL_STACK_ERROR @@ -527,7 +527,7 @@ test_core(void) h5_stat_t sb; herr_t ret; H5FD_file_image_callbacks_t callbacks = {&malloc_cb, &memcpy_cb, &realloc_cb, - &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; + &free_cb, &udata_copy_cb, &udata_free_cb, NULL}; TESTING("Initial file image and callbacks in Core VFD"); @@ -786,10 +786,10 @@ test_get_file_image(const char * test_banner, VERIFY(fd >= 0, "HDopen() failed."); if(size_remaining >= FAMILY_SIZE ){ - bytes_to_read = FAMILY_SIZE; + bytes_to_read = FAMILY_SIZE; size_remaining -= FAMILY_SIZE; } else { - bytes_to_read = size_remaining; + bytes_to_read = size_remaining; size_remaining = 0; } @@ -816,7 +816,7 @@ test_get_file_image(const char * test_banner, */ file_size = (ssize_t)stat_buf.st_size; - /* with latest mods to truncate call in core file drive, + /* with latest mods to truncate call in core file drive, * file size should match image size */ VERIFY(file_size == image_size, "file size != image size."); @@ -940,9 +940,9 @@ test_get_file_image_error_rejection(void) * Since we have already done the necessary setup, verify that * H5Fget_file_image() will fail with: * - * bad file id, or + * bad file id, or * - * good id, but not a file id + * good id, but not a file id */ -- cgit v0.12 From 50445538758d3687acfb2837e595bc68b294ac7b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 11 Apr 2012 12:37:50 -0500 Subject: [svn-r22275] Clear up examples vs applications instances and add minimum file. --- release_docs/Using_CMake.txt | 49 +++++++++++++++++++++++++++++++------------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/release_docs/Using_CMake.txt b/release_docs/Using_CMake.txt index 4819815..71f2fcf 100644 --- a/release_docs/Using_CMake.txt +++ b/release_docs/Using_CMake.txt @@ -1,15 +1,17 @@ ************************************************************************ -* Build and Install HDF5 Examples with CMake * +* Build and Install HDF5 Applications with CMake * ************************************************************************ Notes: This short instruction is written for users who want to quickly build - HDF5 Examples from the HDF5 source code package using the CMake tools. + HDF5 Applications from the HDF5 Examples package using the CMake tools. + Users can adapt these instructions for their own applicaltions, see the + "Minimum Project Files" section. More information about using CMake can be found at the KitWare site, www.cmake.org. CMake uses the command line, however the visual CMake tool is - recommended for the configuration step. The steps are similiar for + available for the configuration step. The steps are similiar for all the operating systems supported by CMake. NOTES: @@ -24,7 +26,7 @@ Notes: This short instruction is written for users who want to quickly build Please send us any comments on how CMake support can be improved on any system. Visit the KitWare site for more information about CMake. - 3. Build and test results can be submitted to our CDash server at: + 3. HDF5 library build and test results can be submitted to our CDash server at: cdash.hdfgroup.uiuc.edu. Please read the HDF and CDash document at: www.hdfgroup.org/CDash/HowToSubmit. @@ -35,21 +37,23 @@ Notes: This short instruction is written for users who want to quickly build ======================================================================== 1. We suggest you obtain the latest CMake for windows from the Kitware - web site. The HDF5 1.8.x product requires CMake version 2.8.6. + web site. The HDF5 1.8.x product requires CMake version 2.8.6 (minimum). - 2. You have installed the HDF5 library built with CMake. If you are - using a Windows platform, you can obtain a pre-built Windows binary - from The HDF Group's website at www.hdfgroup.org. + 2. You have installed the HDF5 library built with CMake, by executing the + HDF Install Utility (The *.exe file in the binary package for Windows). + If you are using a Windows platform, you can obtain a pre-built Windows + binary from The HDF Group's website at www.hdfgroup.org. 3. On Windows with Visual Studio, if you have installed the static HDF5 library, you will need to add the HDF5\lib folder to the library search list. See the "Using Static Libraries with Visual Studio" section. 4. Set the environment variable HDF5_ROOT to the installed location of HDF5. - On Windows HDF5_ROOT=C:\Program Files\HDF Group\HDF5\hdf5-1.8.7 + On Windows HDF5_ROOT=C:\Program Files\HDF Group\HDF5\hdf5-1.8.x + (Note there are no quote characters used on windows) ======================================================================== - Building HDF5 Examples with CMake + Building HDF5 Applications with CMake ======================================================================== 1. Run CMake @@ -113,10 +117,10 @@ Notes: This short instruction is written for users who want to quickly build cmake -G "Visual Studio 9 2008" -DBUILD_TESTING:BOOL=ON -DUSE_SHARED_LIBS:BOOL=ON .. - 3. Build HDF5 examples + 3. Build HDF5 Applications - On Windows, you can build HDF5 using either the Visual Studio Environment - or the command line. The command line is used on linux, Unix, and Mac. + On Windows, you can build HDF5 applications using either the Visual Studio Environment + or the command line. The command line is normally used on linux, Unix, and Mac. To build from the command line, navigate to your build directory and execute the following; @@ -131,7 +135,7 @@ Notes: This short instruction is written for users who want to quickly build file in your build directory. Be sure to select either Debug or Release and build the solution. - 4. Test HDF5 Examples. + 4. Test HDF5 Applications. To test the build, navigate to your build directory and execute; @@ -174,6 +178,23 @@ Notes: This short instruction is written for users who want to quickly build 8.4 If using Fortran libraries, you will also need to setup the path for the Intel Fortran compiler. + +======================================================================== + Minimum C Project Files for CMake +======================================================================== + + 9. Create a CMakeLists.txt file at the source root. +.......................................................................... +cmake_minimum_required (VERSION 2.8.6) +PROJECT (HDF5MyApp C CXX) + +FIND_PACKAGE (HDF5 REQURIED) +INCLUDE_DIRECTORIES (${HDF5_INCLUDE_DIRS}) +SET (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) + +ADD_EXECUTABLE (hdf_example ${PROJECT_SOURCE_DIR}/hdf_example.c) +TARGET_LINK_LIBRARIES (hdf_example ${LINK_LIBS}) +.......................................................................... ************************************************************************ -- cgit v0.12 From 10b62203a35c9107f8b62e3026b4b31895554b7d Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 11 Apr 2012 15:57:10 -0500 Subject: [svn-r22277] Purpose: Fix for HDFFV-7993 - h5repack fails with error "chunk size must be <= maximum dimension size for fixed-sized dimensions" Description: Fixed a failure when change the chunk size of a specified chunked dataset with unlimited max dims. Also took care of converting to contiguous and compact from the dataset. Test cases were added and tagged with jira#. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- MANIFEST | 1 + release_docs/RELEASE.txt | 2 + tools/h5repack/CMakeLists.txt | 31 ++++++-- tools/h5repack/h5repack.c | 9 ++- tools/h5repack/h5repack.h | 1 + tools/h5repack/h5repack.sh.in | 51 +++++++++++--- tools/h5repack/h5repack_copy.c | 46 ++++++++++-- tools/h5repack/h5repack_main.c | 2 + tools/h5repack/h5repack_opttable.c | 13 +++- tools/h5repack/h5repacktst.c | 102 +++++++++++++++++++++++++++ tools/h5repack/testfiles/h5repack_layout3.h5 | Bin 0 -> 966904 bytes 11 files changed, 235 insertions(+), 23 deletions(-) create mode 100644 tools/h5repack/testfiles/h5repack_layout3.h5 diff --git a/MANIFEST b/MANIFEST index a163532..48ba3d3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1944,6 +1944,7 @@ ./tools/h5repack/testfiles/h5repack_layout.h5 ./tools/h5repack/testfiles/h5repack_layouto.h5 ./tools/h5repack/testfiles/h5repack_layout2.h5 +./tools/h5repack/testfiles/h5repack_layout3.h5 ./tools/h5repack/testfiles/h5repack_early.h5 ./tools/h5repack/testfiles/h5repack_szip.h5 ./tools/h5repack/testfiles/h5repack_deflate.h5 diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 8761fb9..836d033 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -696,6 +696,8 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5repack: Fixed a failure when change the chunk size of a specified + chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) - h5diff: Fixed failure for comparing same named object with different object types in comparing groups. Prior to the fix, h5diff resulted in error. After the fix, h5diff detects such case as non-comparable diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index ae7a658..98d5c5a 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -96,6 +96,7 @@ IF (BUILD_TESTING) ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layouto.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout2.h5 + ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_layout3.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_named_dtypes.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_nbit.h5 ${HDF5_TOOLS_H5REPACK_SOURCE_DIR}/testfiles/h5repack_objs.h5 @@ -322,10 +323,12 @@ IF (BUILD_TESTING) -E remove ./testfiles/h5repack_filters.h5.out ./testfiles/h5repack_filters.h5.out.err - ./testfiles/h5repack_layout2.h5-v.out - ./testfiles/h5repack_layout2.h5-v.out.err ./testfiles/h5repack_layout.h5-v.out ./testfiles/h5repack_layout.h5-v.out.err + ./testfiles/h5repack_layout2.h5-v.out + ./testfiles/h5repack_layout2.h5-v.out.err + ./testfiles/h5repack_layout3.h5-v.out + ./testfiles/h5repack_layout3.h5-v.out.err ./testfiles/out.tfamily%05d.h5 ./testfiles/out.h5diff_attr1.h5 ./testfiles/out.h5repack_attr.h5 @@ -336,9 +339,10 @@ IF (BUILD_TESTING) ./testfiles/out.h5repack_filters.h5 ./testfiles/out.h5repack_fletcher.h5 ./testfiles/out.h5repack_hlink.h5 - ./testfiles/out.h5repack_layout2.h5 ./testfiles/out.h5repack_layout.h5 ./testfiles/out.h5repack_layouto.h5 + ./testfiles/out.h5repack_layout2.h5 + ./testfiles/out.h5repack_layout3.h5 ./testfiles/out.h5repack_named_dtypes.h5 ./testfiles/out.h5repack_nbit.h5 ./testfiles/out.h5repack_objs.h5 @@ -369,9 +373,10 @@ IF (BUILD_TESTING) h5repack_fletcher_out.h5 h5repack_hlink.h5 h5repack_hlink_out.h5 - h5repack_layout2.h5 h5repack_layout.h5 h5repack_layout_out.h5 + h5repack_layout2.h5 + h5repack_layout3.h5 h5repack_named_dtypes.h5 h5repack_named_dtypes_out.h5 h5repack_nbit.h5 @@ -777,6 +782,24 @@ IF (BUILD_TESTING) ADD_H5_TEST (contig_small_fixed_compa "TEST" ${FILE18} -l chunked_small_fixed:COMPA) ADD_H5_VERIFY_TEST (contig_small_fixed_compa "TEST" 0 ${FILE18} chunked_small_fixed COMPACT) +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with +# unlimited max dims. (HDFFV-7933) +# Use first dset to test. +#--------------------------------------------------------------------------- +# chunk to chunk - specify chunk dim bigger than any current dim +ADD_H5_TEST (chunk2chunk "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300) +ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) + +# chunk to contiguous +ADD_H5_TEST (chunk2conti "TEST" h5repack_layout3.h5 -l chunk_unlimit1:CONTI) +ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI) + +# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# should remain as original layout (chunk) +ADD_H5_TEST (chunk2compa "TEST" h5repack_layout3.h5 -l chunk_unlimit1:COMPA) +ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK) + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 9778fdd..292f4ec 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -206,10 +206,12 @@ int h5repack_addlayout(const char* str, if (obj_list==NULL) return -1; - /* set global layout option */ + /* set layout option */ + options->layout_g = pack.layout; + + /* no individual dataset specified */ if (options->all_layout==1 ) { - options->layout_g=pack.layout; if (pack.layout==H5D_CHUNKED) { /* -2 means the NONE option, remove chunking @@ -228,6 +230,7 @@ int h5repack_addlayout(const char* str, } } + /* individual dataset specified */ if (options->all_layout==0) options_add_layout(obj_list, n_objs, @@ -504,7 +507,7 @@ int copy_attr(hid_t loc_in, if (type_class == H5T_COMPOUND) { int nmembers = H5Tget_nmembers(wtype_id) ; for (j=0; j $layoutfile $GREP $expectlayout $layoutfile > /dev/null if [ $? -eq 0 ]; then @@ -260,7 +261,7 @@ VERIFY_LAYOUT_ALL() #--------------------------------- # check the layout from a dataset # check if the other layouts still exsit - VERIFY "Layout " + VERIFY "layouts" # if CONTIGUOUS if [ $expectlayout = "CONTIGUOUS" ]; then $RUNSERIAL $H5DUMP_BIN -pH $outfile > $layoutfile @@ -360,7 +361,8 @@ TOOLTEST1() rm -f $outfile } -# Call h5repack and compare output to a text file for -v option +# This is same as TOOLTEST() with comparing display output +# from -v option # TOOLTESTV() { @@ -374,10 +376,20 @@ TOOLTESTV() outfile=$TESTDIR/out.$1 shift $RUNSERIAL $H5REPACK_BIN "$@" $infile $outfile >$actual 2>$actual_err - cp $actual $actual_sav + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + DIFFTEST $infile $outfile + fi + + # display output compare STDOUT_FILTER $actual cat $actual_err >> $actual + VERIFY output from $H5REPACK $@ if cmp -s $expect $actual; then echo " PASSED" else @@ -387,7 +399,8 @@ TOOLTESTV() test yes = "$verbose" && diff -c $expect $actual |sed 's/^/ /' fi - rm -f $actual $actual_err $actual_sav + rm -f $actual $actual_err + rm -f $outfile } # TOOLTEST_META: @@ -559,7 +572,8 @@ arg="h5repack_filters.h5 -v -f /dset_deflate:GZIP=9" if test $USE_FILTER_DEFLATE != "yes" ; then SKIP $arg else - TOOLTEST $arg + # compare output + TOOLTESTV $arg fi ########################################################### @@ -778,6 +792,24 @@ VERIFY_LAYOUT_DSET h5repack_layout2.h5 contig_small COMPACT TOOLTEST_MAIN h5repack_layout2.h5 -l chunked_small_fixed:COMPA VERIFY_LAYOUT_DSET h5repack_layout2.h5 chunked_small_fixed COMPACT +#--------------------------------------------------------------------------- +# Test file contains chunked datasets (need multiple dsets) with +# unlimited max dims. (HDFFV-7933) +# Use first dset to test. +#--------------------------------------------------------------------------- +# chunk to chunk - specify chunk dim bigger than any current dim +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CHUNK=100x300 +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK + +# chunk to contiguous +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:CONTI +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CONTI + +# chunk to compact - convert big dataset (should be > 64k) for this purpose, +# should remain as original layout (chunk) +TOOLTEST_MAIN h5repack_layout3.h5 -l chunk_unlimit1:COMPA +VERIFY_LAYOUT_DSET h5repack_layout3.h5 chunk_unlimit1 CHUNK + # Native option # Do not use FILE1, as the named dtype will be converted to native, and h5diff will # report a difference. @@ -856,8 +888,7 @@ TOOLTEST h5repack_attr_refs.h5 # Note: this test is experimental for sharing test file among tools TOOLTEST h5diff_attr1.h5 -# tests for metadata block size option ('-M') -TOOLTEST_META h5repack_layout.h5 -M 8192 +# tests for metadata block size option TOOLTEST_META h5repack_layout.h5 --metadata_block_size=8192 if test $nerrors -eq 0 ; then diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index d38a15c..957d3c8 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -778,6 +778,8 @@ int do_copy_objects(hid_t fidin, unsigned u; int is_ref=0; htri_t is_named; + hbool_t limit_maxdims; + hsize_t size_dset; /*------------------------------------------------------------------------- @@ -794,8 +796,10 @@ int do_copy_objects(hid_t fidin, for ( i = 0; i < travt->nobjs; i++) { - + /* init variables per obj */ buf = NULL; + limit_maxdims = FALSE; + switch ( travt->objs[i].type ) { @@ -970,6 +974,9 @@ int do_copy_objects(hid_t fidin, if((msize = H5Tget_size(wtype_id)) == 0) goto error; + /* size of current dset */ + size_dset = nelmts * msize; + /*------------------------------------------------------------------------- * check if the dataset creation property list has filters that * are not registered in the current configuration @@ -999,7 +1006,7 @@ int do_copy_objects(hid_t fidin, */ if (options->layout_g != H5D_COMPACT) { - if ( nelmts*msize < options->min_comp ) + if ( size_dset < options->min_comp ) apply_s=0; } @@ -1016,9 +1023,38 @@ int do_copy_objects(hid_t fidin, goto error; } - /* unset the unlimimted dimensions, which cannot be applied to layout other than chunked. */ - if (options->layout_g != H5D_CHUNKED) { - H5Sset_extent_simple( f_space_id, rank, dims, NULL ); + /*------------------------------------------------- + * Unset the unlimited max dims if convert to other + * than chunk layouts, because unlimited max dims + * only can be applied to chunk layout. + * Also perform only for targeted dataset + * Also check for size limit to convert to compact + *-------------------------------------------------*/ + if (options->layout_g != H5D_CHUNKED) + { + /* any dataset is specified */ + if (options->op_tbl->nelems > 0) + { + /* if current obj match specified obj */ + if (options_get_object (travt->objs[i].name, options->op_tbl)) + limit_maxdims = TRUE; + } + else /* no dataset is specified */ + { + limit_maxdims = TRUE; + } + + /* if convert to COMPACT */ + if (options->layout_g == H5D_COMPACT) + { + /* should be smaller than 64K */ + if ( size_dset > MAX_COMPACT_DSIZE ) + limit_maxdims = FALSE; + } + + /* unset unlimited max dims */ + if (limit_maxdims) + H5Sset_extent_simple( f_space_id, rank, dims, NULL ); } /*------------------------------------------------------------------------- diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index 6004084..f61c961 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -466,6 +466,8 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options) options->fs_threshold = (hsize_t)HDatol( opt_arg ); break; + default: + break; } /* switch */ diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index d0fcff3..4ec7fcf 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -388,11 +388,22 @@ pack_info_t* options_get_object( const char *path, pack_opttbl_t *table ) { unsigned int i; + const char tbl_path[MAX_NC_NAME]; + for ( i = 0; i < table->nelems; i++) { + /* make full path (start with "/") to compare correctly */ + if (HDstrncmp(table->objs[i].path, "/", 1)) + { + HDstrcpy(tbl_path, "/"); + HDstrcat(tbl_path, table->objs[i].path); + } + else + HDstrcpy(tbl_path, table->objs[i].path); + /* found it */ - if (HDstrcmp(table->objs[i].path,path)==0) + if (HDstrcmp(tbl_path, path)==0) { return (&table->objs[i]); } diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 6b15f0a..bc94eed 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -124,6 +124,7 @@ static int make_hlinks(hid_t loc_id); static int make_early(void); static int make_layout(hid_t loc_id); static int make_layout2(hid_t loc_id); +static int make_layout3(hid_t loc_id); #ifdef H5_HAVE_FILTER_SZIP static int make_szip(hid_t loc_id); #endif /* H5_HAVE_FILTER_SZIP */ @@ -1712,6 +1713,19 @@ int make_testfiles(void) return -1; /*------------------------------------------------------------------------- + * for test layout conversions form chunk with unlimited max dims + *------------------------------------------------------------------------- + */ + if((fid = H5Fcreate("h5repack_layout3.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + return -1; + + if(make_layout3(fid) < 0) + goto out; + + if(H5Fclose(fid) < 0) + return -1; + + /*------------------------------------------------------------------------- * create a file for the H5D_ALLOC_TIME_EARLY test *------------------------------------------------------------------------- */ @@ -3075,6 +3089,94 @@ out: } /* make_layout2() */ /*------------------------------------------------------------------------- +* Function: make_layout3 +* +* Purpose: make chunked datasets with unlimited max dim and chunk dim is +* bigger than current dim. (HDFFV-7933) +* Test for converting chunk to chunk , chunk to conti and chunk +* to compact. +* - The chunk to chunk changes layout bigger than any current dim +* again. +* - The chunk to compact test dataset bigger than 64K, should +* remain original layout.* +* +*------------------------------------------------------------------------- +*/ +#define DIM1_L3 300 +#define DIM2_L3 200 +static +int make_layout3(hid_t loc_id) +{ + hid_t dcpl=-1; /* dataset creation property list */ + hid_t sid=-1; /* dataspace ID */ + hsize_t dims[RANK]={DIM1_L3,DIM2_L3}; + hsize_t maxdims[RANK]={H5S_UNLIMITED, H5S_UNLIMITED}; + hsize_t chunk_dims[RANK]={DIM1_L3*2,5}; + int buf[DIM1_L3][DIM2_L3]; + int i, j, n; + + for (i=n=0; i Date: Sun, 15 Apr 2012 09:36:51 -0500 Subject: [svn-r22286] Snapshot version 1.9 release 114 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index df15871..397c6d3 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.114 currently under development +HDF5 version 1.9.115 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 395c76c..aa50847 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 316d0c9..6c3ac83 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 1ef6534..ef7ff7b 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22149 2012-03-26 20:26:06Z mamcgree . +# From configure.in Id: configure.in 22257 2012-04-08 14:40:16Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.114. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.115. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.114' -PACKAGE_STRING='HDF5 1.9.114' +PACKAGE_VERSION='1.9.115' +PACKAGE_STRING='HDF5 1.9.115' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.114 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.115 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.114:";; + short | recursive ) echo "Configuration of HDF5 1.9.115:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.114 +HDF5 configure 1.9.115 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.114, which was +It was created by HDF5 $as_me 1.9.115, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.114' + VERSION='1.9.115' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.114, which was +This file was extended by HDF5 $as_me 1.9.115, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.114 +HDF5 config.status 1.9.115 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.114 +HDF5 config.lt 1.9.115 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 5459013..c0ad348 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.114], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.115], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 875f6f7..3318c14 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 9efbd24..f89a5ea 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index afefdc7..dd1f061 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index f4875bd..2509c94 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 836d033..948eb2b 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.114 currently under development +HDF5 version 1.9.115 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index e36c0eb..d9a7658 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 114 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 115 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.114" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.115" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 37dc102..a169b1c 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 104 +LT_VERS_REVISION = 105 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index ba723f4..4013128 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.114" +#define H5_PACKAGE_STRING "HDF5 1.9.115" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.114" +#define H5_PACKAGE_VERSION "1.9.115" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.114" +#define H5_VERSION "1.9.115" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index a37c206..063f8ef 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.114" +#define H5_PACKAGE_STRING "HDF5 1.9.115" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.114" +#define H5_PACKAGE_VERSION "1.9.115" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.114" +#define H5_VERSION "1.9.115" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From a07c8f924703bdf3d1654b59cabf847f5d0f2683 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 16 Apr 2012 16:20:26 -0500 Subject: [svn-r22287] Description: Clean up more FUNC_ENTER/FUNC_LEAVE macros and move H5D & H5T code toward the final design (as exemplified by the H5EA & H5FA code). Tested on: Mac OSX/64 10.7.3 (amazon) w/debug & parallel --- src/H5D.c | 35 +- src/H5Dbtree.c | 326 ++++++------ src/H5Dchunk.c | 620 +++++++++++------------ src/H5Dcompact.c | 100 ++-- src/H5Dcontig.c | 227 ++++----- src/H5Ddbg.c | 14 +- src/H5Ddeprec.c | 34 +- src/H5Defl.c | 146 +++--- src/H5Dfill.c | 56 ++- src/H5Dint.c | 311 ++++++------ src/H5Dio.c | 116 ++--- src/H5Dlayout.c | 48 +- src/H5Dmpio.c | 290 ++++++----- src/H5Doh.c | 116 +++-- src/H5Dpkg.h | 140 +++--- src/H5Dprivate.h | 6 - src/H5Dscatgath.c | 96 ++-- src/H5Dselect.c | 31 +- src/H5Dtest.c | 30 +- src/H5Odtype.c | 20 +- src/H5Olayout.c | 16 +- src/H5T.c | 457 ++++++++--------- src/H5Tarray.c | 40 +- src/H5Tbit.c | 110 ++-- src/H5Tcommit.c | 12 +- src/H5Tcompound.c | 36 +- src/H5Tconv.c | 1052 +++++++++++++++++++-------------------- src/H5Tdbg.c | 8 +- src/H5Tenum.c | 37 +- src/H5Tfields.c | 22 +- src/H5Tnative.c | 22 +- src/H5Toh.c | 2 +- src/H5Tpkg.h | 406 ++++++++------- src/H5Tvisit.c | 12 +- src/H5Tvlen.c | 20 +- src/H5detect.c | 2 +- src/H5private.h | 36 +- test/bittests.c | 104 ++-- test/cmpd_dset.c | 2 +- test/dt_arith.c | 114 ++--- test/external.c | 6 +- test/testfiles/error_test_1 | 6 +- test/tmisc.c | 84 ++-- testpar/t_dset.c | 2 +- tools/lib/h5tools_dump.c | 8 +- tools/misc/h5debug.c | 49 +- tools/testfiles/filter_fail.ddl | 6 +- 47 files changed, 2732 insertions(+), 2701 deletions(-) diff --git a/src/H5D.c b/src/H5D.c index 7cb0cc6..cf93399 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -20,7 +20,7 @@ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D_init_pub_interface +#define H5_INTERFACE_INIT_FUNC H5D__init_pub_interface /***********/ @@ -47,6 +47,8 @@ /* Local Prototypes */ /********************/ +static herr_t H5D__init_pub_interface(void); + /*********************/ /* Package Variables */ @@ -75,9 +77,9 @@ H5FL_BLK_EXTERN(type_conv); /*-------------------------------------------------------------------------- NAME - H5D_init_pub_interface -- Initialize interface-specific information + H5D__init_pub_interface -- Initialize interface-specific information USAGE - herr_t H5D_init_pub_interface() + herr_t H5D__init_pub_interface() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -86,12 +88,12 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5D_init_pub_interface(void) +H5D__init_pub_interface(void) { - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D_init_pub_interface() */ +} /* H5D__init_pub_interface() */ /*------------------------------------------------------------------------- @@ -248,7 +250,7 @@ H5Dcreate_anon(hid_t loc_id, hid_t type_id, hid_t space_id, hid_t dcpl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not dataset access property list") /* build and open the new dataset */ - if(NULL == (dset = H5D_create(loc.oloc->file, type_id, space, dcpl_id, dapl_id, H5AC_dxpl_id))) + if(NULL == (dset = H5D__create(loc.oloc->file, type_id, space, dcpl_id, dapl_id, H5AC_dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create dataset") /* Register the new dataset to get an ID for it */ @@ -484,7 +486,7 @@ H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset") /* Read data space address and return */ - if(FAIL==(ret_value=H5D_get_space_status(dset, allocation, H5AC_ind_dxpl_id))) + if(H5D__get_space_status(dset, allocation, H5AC_ind_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to get space status") done: @@ -786,7 +788,8 @@ H5Dget_storage_size(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset") /* Set return value */ - ret_value = H5D_get_storage_size(dset, H5AC_ind_dxpl_id); + if(H5D__get_storage_size(dset, H5AC_ind_dxpl_id, &ret_value) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't get size of dataset's storage") done: FUNC_LEAVE_API(ret_value) @@ -821,7 +824,9 @@ H5Dget_offset(hid_t dset_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "not a dataset") /* Set return value */ - ret_value = H5D_get_offset(dset); + ret_value = H5D__get_offset(dset); + if(!H5F_addr_defined(ret_value)) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, HADDR_UNDEF, "unable to get space status") done: FUNC_LEAVE_API(ret_value) @@ -909,7 +914,7 @@ H5Diterate(void *buf, hid_t type_id, hid_t space_id, H5D_operator_t op, if(!(H5S_has_extent(space))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "dataspace does not have extent set") - ret_value = H5D_iterate(buf, type_id, space, op, operator_data); + ret_value = H5D__iterate(buf, type_id, space, op, operator_data); done: FUNC_LEAVE_API(ret_value) @@ -1040,14 +1045,14 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list") /* Set the memory manager to the special allocation routine */ - if(H5P_set_vlen_mem_manager(plist, H5D_vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) + if(H5P_set_vlen_mem_manager(plist, H5D__vlen_get_buf_size_alloc, &vlen_bufsize, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set VL data allocation routine") /* Set the initial number of bytes required */ vlen_bufsize.size = 0; - /* Call H5D_iterate with args, etc. */ - ret_value = H5D_iterate(&bogus, type_id, space, H5D_vlen_get_buf_size, &vlen_bufsize); + /* Call H5D__iterate with args, etc. */ + ret_value = H5D__iterate(&bogus, type_id, space, H5D__vlen_get_buf_size, &vlen_bufsize); /* Get the size if we succeeded */ if(ret_value >= 0) @@ -1098,7 +1103,7 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") /* Private function */ - if(H5D_set_extent(dset, size, H5AC_dxpl_id) < 0) + if(H5D__set_extent(dset, size, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset") done: diff --git a/src/H5Dbtree.c b/src/H5Dbtree.c index b5cfcce..50af977 100644 --- a/src/H5Dbtree.c +++ b/src/H5Dbtree.c @@ -97,58 +97,58 @@ typedef struct H5D_btree_dbg_t { /* Local Prototypes */ /********************/ -static herr_t H5D_btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, +static herr_t H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndims); /* B-tree iterator callbacks */ -static int H5D_btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_key, +static int H5D__btree_idx_iterate_cb(H5F_t *f, hid_t dxpl_id, const void *left_key, haddr_t addr, const void *right_key, void *_udata); /* B-tree callbacks */ -static H5RC_t *H5D_btree_get_shared(const H5F_t *f, const void *_udata); -static herr_t H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key, +static H5RC_t *H5D__btree_get_shared(const H5F_t *f, const void *_udata); +static herr_t H5D__btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p /*out*/); -static int H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key); -static int H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key); -static htri_t H5D_btree_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static int H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key); +static int H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key); +static htri_t H5D__btree_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key, void *_udata); -static H5B_ins_t H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, +static H5B_ins_t H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t *rt_key_changed, haddr_t *new_node/*out*/); -static H5B_ins_t H5D_btree_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr, +static H5B_ins_t H5D__btree_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_udata, void *_rt_key, hbool_t *rt_key_changed); -static herr_t H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, +static herr_t H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key); -static herr_t H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, +static herr_t H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key); -static herr_t H5D_btree_debug_key(FILE *stream, int indent, int fwidth, +static herr_t H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *key, const void *udata); /* Chunked layout indexing callbacks */ -static herr_t H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t *space, haddr_t dset_ohdr_addr); -static herr_t H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info); -static hbool_t H5D_btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage); -static herr_t H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info); +static hbool_t H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage); +static herr_t H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static herr_t H5D_btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata); -static int H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, +static int H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, void *chunk_udata); -static herr_t H5D_btree_idx_remove(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata); -static herr_t H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info); -static herr_t H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, +static herr_t H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst); -static herr_t H5D_btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, +static herr_t H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst, hid_t dxpl_id); -static herr_t H5D_btree_idx_size(const H5D_chk_idx_info_t *idx_info, +static herr_t H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *size); -static herr_t H5D_btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -static herr_t H5D_btree_idx_dump(const H5O_storage_chunk_t *storage, +static herr_t H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); +static herr_t H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream); -static herr_t H5D_btree_idx_dest(const H5D_chk_idx_info_t *idx_info); +static herr_t H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info); /*********************/ @@ -157,21 +157,21 @@ static herr_t H5D_btree_idx_dest(const H5D_chk_idx_info_t *idx_info); /* v1 B-tree indexed chunk I/O ops */ const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{ - H5D_btree_idx_init, - H5D_btree_idx_create, - H5D_btree_idx_is_space_alloc, - H5D_btree_idx_insert, - H5D_btree_idx_get_addr, + H5D__btree_idx_init, + H5D__btree_idx_create, + H5D__btree_idx_is_space_alloc, + H5D__btree_idx_insert, + H5D__btree_idx_get_addr, NULL, - H5D_btree_idx_iterate, - H5D_btree_idx_remove, - H5D_btree_idx_delete, - H5D_btree_idx_copy_setup, - H5D_btree_idx_copy_shutdown, - H5D_btree_idx_size, - H5D_btree_idx_reset, - H5D_btree_idx_dump, - H5D_btree_idx_dest + H5D__btree_idx_iterate, + H5D__btree_idx_remove, + H5D__btree_idx_delete, + H5D__btree_idx_copy_setup, + H5D__btree_idx_copy_shutdown, + H5D__btree_idx_size, + H5D__btree_idx_reset, + H5D__btree_idx_dump, + H5D__btree_idx_dest }}; @@ -183,19 +183,19 @@ const H5D_chunk_ops_t H5D_COPS_BTREE[1] = {{ H5B_class_t H5B_BTREE[1] = {{ H5B_CHUNK_ID, /*id */ sizeof(H5D_btree_key_t), /*sizeof_nkey */ - H5D_btree_get_shared, /*get_shared */ - H5D_btree_new_node, /*new */ - H5D_btree_cmp2, /*cmp2 */ - H5D_btree_cmp3, /*cmp3 */ - H5D_btree_found, /*found */ - H5D_btree_insert, /*insert */ + H5D__btree_get_shared, /*get_shared */ + H5D__btree_new_node, /*new */ + H5D__btree_cmp2, /*cmp2 */ + H5D__btree_cmp3, /*cmp3 */ + H5D__btree_found, /*found */ + H5D__btree_insert, /*insert */ FALSE, /*follow min branch? */ FALSE, /*follow max branch? */ H5B_LEFT, /*critical key */ - H5D_btree_remove, /*remove */ - H5D_btree_decode_key, /*decode */ - H5D_btree_encode_key, /*encode */ - H5D_btree_debug_key, /*debug */ + H5D__btree_remove, /*remove */ + H5D__btree_decode_key, /*decode */ + H5D__btree_encode_key, /*encode */ + H5D__btree_debug_key, /*debug */ }}; @@ -205,7 +205,7 @@ H5B_class_t H5B_BTREE[1] = {{ /*------------------------------------------------------------------------- - * Function: H5D_btree_get_shared + * Function: H5D__btree_get_shared * * Purpose: Returns the shared B-tree info for the specified UDATA. * @@ -220,11 +220,11 @@ H5B_class_t H5B_BTREE[1] = {{ */ /* ARGSUSED */ static H5RC_t * -H5D_btree_get_shared(const H5F_t UNUSED *f, const void *_udata) +H5D__btree_get_shared(const H5F_t UNUSED *f, const void *_udata) { const H5D_chunk_common_ud_t *udata = (const H5D_chunk_common_ud_t *) _udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(udata); HDassert(udata->storage); @@ -233,11 +233,11 @@ H5D_btree_get_shared(const H5F_t UNUSED *f, const void *_udata) /* Return the pointer to the ref-count object */ FUNC_LEAVE_NOAPI(udata->storage->u.btree.shared) -} /* end H5D_btree_get_shared() */ +} /* end H5D__btree_get_shared() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_new_node + * Function: H5D__btree_new_node * * Purpose: Adds a new entry to an i-storage B-tree. We can assume that * the domain represented by UDATA doesn't intersect the domain @@ -255,7 +255,7 @@ H5D_btree_get_shared(const H5F_t UNUSED *f, const void *_udata) *------------------------------------------------------------------------- */ static herr_t -H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, +H5D__btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key, void *_udata, void *_rt_key, haddr_t *addr_p/*out*/) { @@ -265,7 +265,7 @@ H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, unsigned u; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -307,11 +307,11 @@ H5D_btree_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_new_node() */ +} /* end H5D__btree_new_node() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_cmp2 + * Function: H5D__btree_cmp2 * * Purpose: Compares two keys sort of like strcmp(). The UDATA pointer * is only to supply extra information not carried in the keys @@ -330,14 +330,14 @@ done: *------------------------------------------------------------------------- */ static int -H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) +H5D__btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key; H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(lt_key); HDassert(rt_key); @@ -348,11 +348,11 @@ H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) ret_value = H5V_vector_cmp_u(udata->layout->ndims, lt_key->offset, rt_key->offset); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_cmp2() */ +} /* end H5D__btree_cmp2() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_cmp3 + * Function: H5D__btree_cmp3 * * Purpose: Compare the requested datum UDATA with the left and right * keys of the B-tree. @@ -379,14 +379,14 @@ H5D_btree_cmp2(void *_lt_key, void *_udata, void *_rt_key) *------------------------------------------------------------------------- */ static int -H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) +H5D__btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) { H5D_btree_key_t *lt_key = (H5D_btree_key_t *) _lt_key; H5D_btree_key_t *rt_key = (H5D_btree_key_t *) _rt_key; H5D_chunk_common_ud_t *udata = (H5D_chunk_common_ud_t *) _udata; int ret_value = 0; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(lt_key); HDassert(rt_key); @@ -416,11 +416,11 @@ H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) } /* end else */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_cmp3() */ +} /* end H5D__btree_cmp3() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_found + * Function: H5D__btree_found * * Purpose: This function is called when the B-tree search engine has * found the leaf entry that points to a chunk of storage that @@ -445,7 +445,7 @@ H5D_btree_cmp3(void *_lt_key, void *_udata, void *_rt_key) */ /* ARGSUSED */ static htri_t -H5D_btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void *_lt_key, +H5D__btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void *_lt_key, void *_udata) { H5D_chunk_ud_t *udata = (H5D_chunk_ud_t *) _udata; @@ -453,7 +453,7 @@ H5D_btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void unsigned u; htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check arguments */ HDassert(f); @@ -474,11 +474,11 @@ H5D_btree_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_found() */ +} /* end H5D__btree_found() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_insert + * Function: H5D__btree_insert * * Purpose: This function is called when the B-tree insert engine finds * the node to use to insert new data. The UDATA argument @@ -507,7 +507,7 @@ done: */ /* ARGSUSED */ static H5B_ins_t -H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, +H5D__btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, hbool_t *lt_key_changed, void *_md_key, void *_udata, void *_rt_key, hbool_t UNUSED *rt_key_changed, @@ -521,7 +521,7 @@ H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, unsigned u; H5B_ins_t ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(f); @@ -533,7 +533,7 @@ H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, HDassert(rt_key); HDassert(new_node_p); - cmp = H5D_btree_cmp3(lt_key, udata, rt_key); + cmp = H5D__btree_cmp3(lt_key, udata, rt_key); HDassert(cmp <= 0); if(cmp < 0) { @@ -611,11 +611,11 @@ H5D_btree_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_insert() */ +} /* end H5D__btree_insert() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_remove + * Function: H5D__btree_remove * * Purpose: Removes chunks that are no longer necessary in the B-tree. * @@ -629,7 +629,7 @@ done: */ /* ARGSUSED */ static H5B_ins_t -H5D_btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ , +H5D__btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ , hbool_t *lt_key_changed /*out */ , void UNUSED * _udata /*in,out */ , void UNUSED * _rt_key /*in,out */ , @@ -638,7 +638,7 @@ H5D_btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out * H5D_btree_key_t *lt_key = (H5D_btree_key_t *)_lt_key; H5B_ins_t ret_value=H5B_INS_REMOVE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Remove raw data chunk from file */ H5_CHECK_OVERFLOW(lt_key->nbytes, uint32_t, hsize_t); @@ -651,11 +651,11 @@ H5D_btree_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out * done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_remove() */ +} /* end H5D__btree_remove() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_decode_key + * Function: H5D__btree_decode_key * * Purpose: Decodes a raw key into a native key for the B-tree * @@ -667,13 +667,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) +H5D__btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) { H5D_btree_key_t *key = (H5D_btree_key_t *) _key; size_t ndims; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(shared); @@ -689,11 +689,11 @@ H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) UINT64DECODE(raw, key->offset[u]); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_btree_decode_key() */ +} /* end H5D__btree_decode_key() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_encode_key + * Function: H5D__btree_encode_key * * Purpose: Encode a key from native format to raw format. * @@ -705,13 +705,13 @@ H5D_btree_decode_key(const H5B_shared_t *shared, const uint8_t *raw, void *_key) *------------------------------------------------------------------------- */ static herr_t -H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) +H5D__btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) { const H5D_btree_key_t *key = (const H5D_btree_key_t *)_key; size_t ndims; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(shared); @@ -727,11 +727,11 @@ H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) UINT64ENCODE(raw, key->offset[u]); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_btree_encode_key() */ +} /* end H5D__btree_encode_key() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_debug_key + * Function: H5D__btree_debug_key * * Purpose: Prints a key. * @@ -744,14 +744,14 @@ H5D_btree_encode_key(const H5B_shared_t *shared, uint8_t *raw, const void *_key) */ /* ARGSUSED */ static herr_t -H5D_btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, +H5D__btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, const void *_udata) { const H5D_btree_key_t *key = (const H5D_btree_key_t *)_key; const H5D_btree_dbg_t *udata = (const H5D_btree_dbg_t *)_udata; unsigned u; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(key); @@ -763,11 +763,11 @@ H5D_btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, HDfputs("}\n", stream); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_btree_debug_key() */ +} /* end H5D__btree_debug_key() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_shared_create + * Function: H5D__btree_shared_create * * Purpose: Create & initialize B-tree shared info * @@ -779,13 +779,13 @@ H5D_btree_debug_key(FILE *stream, int indent, int fwidth, const void *_key, *------------------------------------------------------------------------- */ static herr_t -H5D_btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndims) +H5D__btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndims) { H5B_shared_t *shared; /* Shared B-tree node info */ size_t sizeof_rkey; /* Size of raw (disk) key */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Set the raw key size */ sizeof_rkey = 4 + /*storage size */ @@ -805,11 +805,11 @@ H5D_btree_shared_create(const H5F_t *f, H5O_storage_chunk_t *store, unsigned ndi done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_shared_create() */ +} /* end H5D__btree_shared_create() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_init + * Function: H5D__btree_idx_init * * Purpose: Initialize the indexing information for a dataset. * @@ -821,12 +821,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space, +H5D__btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space, haddr_t dset_ohdr_addr) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(idx_info); @@ -839,16 +839,16 @@ H5D_btree_idx_init(const H5D_chk_idx_info_t *idx_info, const H5S_t UNUSED *space idx_info->storage->u.btree.dset_ohdr_addr = dset_ohdr_addr; /* Allocate the shared structure */ - if(H5D_btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_init() */ +} /* end H5D__btree_idx_init() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_create + * Function: H5D__btree_idx_create * * Purpose: Creates a new indexed-storage B-tree and initializes the * layout struct with information about the storage. The @@ -866,12 +866,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info) +H5D__btree_idx_create(const H5D_chk_idx_info_t *idx_info) { H5D_chunk_common_ud_t udata; /* User data for B-tree callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(idx_info); @@ -891,11 +891,11 @@ H5D_btree_idx_create(const H5D_chk_idx_info_t *idx_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_create() */ +} /* end H5D__btree_idx_create() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_is_space_alloc + * Function: H5D__btree_idx_is_space_alloc * * Purpose: Query if space is allocated for index method * @@ -907,11 +907,11 @@ done: *------------------------------------------------------------------------- */ static hbool_t -H5D_btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) +H5D__btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(storage); @@ -920,11 +920,11 @@ H5D_btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) ret_value = (hbool_t)H5F_addr_defined(storage->idx_addr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_is_space_alloc() */ +} /* end H5D__btree_idx_is_space_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_insert + * Function: H5D__btree_idx_insert * * Purpose: Create the chunk it if it doesn't exist, or reallocate the * chunk if its size changed. @@ -937,11 +937,11 @@ H5D_btree_idx_is_space_alloc(const H5O_storage_chunk_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) +H5D__btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(idx_info); HDassert(idx_info->f); @@ -960,11 +960,11 @@ H5D_btree_idx_insert(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_btree_idx_insert() */ +} /* H5D__btree_idx_insert() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_get_addr + * Function: H5D__btree_idx_get_addr * * Purpose: Get the file address of a chunk if file space has been * assigned. Save the retrieved information in the udata @@ -978,11 +978,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) +H5D__btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(idx_info); HDassert(idx_info->f); @@ -999,11 +999,11 @@ H5D_btree_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *udata done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_btree_idx_get_addr() */ +} /* H5D__btree_idx_get_addr() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_iterate_cb + * Function: H5D__btree_idx_iterate_cb * * Purpose: Translate the B-tree specific chunk record into a generic * form and make the callback to the generic chunk callback @@ -1019,7 +1019,7 @@ done: */ /* ARGSUSED */ static int -H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, +H5D__btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key, haddr_t addr, const void UNUSED *_rt_key, void *_udata) { @@ -1028,7 +1028,7 @@ H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, H5D_chunk_rec_t chunk_rec; /* Generic chunk record for callback */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check for memcpy() */ HDcompile_assert(offsetof(H5D_chunk_rec_t, nbytes) == offsetof(H5D_btree_key_t, nbytes)); @@ -1047,11 +1047,11 @@ H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, HERROR(H5E_DATASET, H5E_CALLBACK, "failure in generic chunk iterator callback"); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_btree_idx_iterate_cb() */ +} /* H5D__btree_idx_iterate_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_iterate + * Function: H5D__btree_idx_iterate * * Purpose: Iterate over the chunks in an index, making a callback * for each one. @@ -1064,13 +1064,13 @@ H5D_btree_idx_iterate_cb(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, *------------------------------------------------------------------------- */ static int -H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, +H5D__btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, H5D_chunk_cb_func_t chunk_cb, void *chunk_udata) { H5D_btree_it_ud_t udata; /* User data for B-tree iterator callback */ int ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(idx_info); HDassert(idx_info->f); @@ -1089,15 +1089,15 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, udata.udata = chunk_udata; /* Iterate over existing chunks */ - if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, H5D_btree_idx_iterate_cb, &udata)) < 0) + if((ret_value = H5B_iterate(idx_info->f, idx_info->dxpl_id, H5B_BTREE, idx_info->storage->idx_addr, H5D__btree_idx_iterate_cb, &udata)) < 0) HERROR(H5E_DATASET, H5E_BADITER, "unable to iterate over chunk B-tree"); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_iterate() */ +} /* end H5D__btree_idx_iterate() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_remove + * Function: H5D__btree_idx_remove * * Purpose: Remove chunk from index. * @@ -1109,11 +1109,11 @@ H5D_btree_idx_iterate(const H5D_chk_idx_info_t *idx_info, *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata) +H5D__btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t *udata) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(idx_info); HDassert(idx_info->f); @@ -1131,11 +1131,11 @@ H5D_btree_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t * done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_btree_idx_remove() */ +} /* H5D__btree_idx_remove() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_delete + * Function: H5D__btree_idx_delete * * Purpose: Delete index and raw data storage for entire dataset * (i.e. all chunks) @@ -1149,11 +1149,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) +H5D__btree_idx_delete(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(idx_info); @@ -1171,7 +1171,7 @@ H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) tmp_storage = *idx_info->storage; /* Set up the shared structure */ - if(H5D_btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, &tmp_storage, idx_info->layout->ndims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") /* Set up B-tree user data */ @@ -1192,11 +1192,11 @@ H5D_btree_idx_delete(const H5D_chk_idx_info_t *idx_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_delete() */ +} /* end H5D__btree_idx_delete() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_copy_setup + * Function: H5D__btree_idx_copy_setup * * Purpose: Set up any necessary information for copying chunks * @@ -1208,12 +1208,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, +H5D__btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, const H5D_chk_idx_info_t *idx_info_dst) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) + FUNC_ENTER_STATIC_TAG(idx_info_dst->dxpl_id, H5AC__COPIED_TAG, FAIL) HDassert(idx_info_src); HDassert(idx_info_src->f); @@ -1228,23 +1228,23 @@ H5D_btree_idx_copy_setup(const H5D_chk_idx_info_t *idx_info_src, HDassert(!H5F_addr_defined(idx_info_dst->storage->idx_addr)); /* Create shared B-tree info for each file */ - if(H5D_btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info_src->f, idx_info_src->storage, idx_info_src->layout->ndims) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for source shared B-tree info") - if(H5D_btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info_dst->f, idx_info_dst->storage, idx_info_dst->layout->ndims) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for destination shared B-tree info") /* Create the root of the B-tree that describes chunked storage in the dest. file */ - if(H5D_btree_idx_create(idx_info_dst) < 0) + if(H5D__btree_idx_create(idx_info_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") HDassert(H5F_addr_defined(idx_info_dst->storage->idx_addr)); done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_btree_idx_copy_setup() */ +} /* end H5D__btree_idx_copy_setup() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_copy_shutdown + * Function: H5D__btree_idx_copy_shutdown * * Purpose: Shutdown any information from copying chunks * @@ -1256,13 +1256,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, +H5D__btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, H5O_storage_chunk_t *storage_dst, hid_t UNUSED dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(storage_src); HDassert(storage_dst); @@ -1275,11 +1275,11 @@ H5D_btree_idx_copy_shutdown(H5O_storage_chunk_t *storage_src, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_copy_shutdown() */ +} /* end H5D__btree_idx_copy_shutdown() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_size + * Function: H5D__btree_idx_size * * Purpose: Retrieve the amount of index storage for chunked dataset * @@ -1292,14 +1292,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) +H5D__btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) { H5D_chunk_common_ud_t udata; /* User-data for loading B-tree nodes */ H5B_info_t bt_info; /* B-tree info */ hbool_t shared_init = FALSE; /* Whether shared B-tree info is initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(idx_info); @@ -1310,7 +1310,7 @@ H5D_btree_idx_size(const H5D_chk_idx_info_t *idx_info, hsize_t *index_size) HDassert(index_size); /* Initialize the shared info for the B-tree traversal */ - if(H5D_btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) + if(H5D__btree_shared_create(idx_info->f, idx_info->storage, idx_info->layout->ndims) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") shared_init = TRUE; @@ -1335,11 +1335,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_size() */ +} /* end H5D__btree_idx_size() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_reset + * Function: H5D__btree_idx_reset * * Purpose: Reset indexing information. * @@ -1351,9 +1351,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) +H5D__btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(storage); @@ -1363,11 +1363,11 @@ H5D_btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) storage->u.btree.shared = NULL; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_btree_idx_reset() */ +} /* end H5D__btree_idx_reset() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_dump + * Function: H5D__btree_idx_dump * * Purpose: Dump indexing information to a stream. * @@ -1379,9 +1379,9 @@ H5D_btree_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr) *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) +H5D__btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(storage); HDassert(stream); @@ -1389,11 +1389,11 @@ H5D_btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) HDfprintf(stream, " Address: %a\n", storage->idx_addr); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_btree_idx_dump() */ +} /* end H5D__btree_idx_dump() */ /*------------------------------------------------------------------------- - * Function: H5D_btree_idx_dest + * Function: H5D__btree_idx_dest * * Purpose: Release indexing information in memory. * @@ -1405,11 +1405,11 @@ H5D_btree_idx_dump(const H5O_storage_chunk_t *storage, FILE *stream) *------------------------------------------------------------------------- */ static herr_t -H5D_btree_idx_dest(const H5D_chk_idx_info_t *idx_info) +H5D__btree_idx_dest(const H5D_chk_idx_info_t *idx_info) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(idx_info); HDassert(idx_info->f); @@ -1425,7 +1425,7 @@ H5D_btree_idx_dest(const H5D_chk_idx_info_t *idx_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_btree_idx_dest() */ +} /* end H5D__btree_idx_dest() */ /*------------------------------------------------------------------------- @@ -1456,7 +1456,7 @@ H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent storage.idx_type = H5D_CHUNK_BTREE; /* Allocate the shared structure */ - if(H5D_btree_shared_create(f, &storage, ndims) < 0) + if(H5D__btree_shared_create(f, &storage, ndims) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info") shared_init = TRUE; diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index af888a9..dfb4011 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -174,48 +174,54 @@ typedef struct H5D_chunk_readvv_ud_t { /********************/ /* Chunked layout operation callbacks */ -static herr_t H5D_chunk_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D_chunk_io_init(const H5D_io_info_t *io_info, +static herr_t H5D__chunk_construct(H5F_t *f, H5D_t *dset); +static herr_t H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +static herr_t H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +static herr_t H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -static herr_t H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id); -static herr_t H5D_chunk_io_term(const H5D_chunk_map_t *fm); +static herr_t H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__chunk_io_term(const H5D_chunk_map_t *fm); +static herr_t H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); /* "Nonexistent" layout operation callback */ static ssize_t -H5D_nonexistent_readvv(const H5D_io_info_t *io_info, +H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); /* Helper routines */ -static herr_t H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, +static herr_t H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims); -static void *H5D_chunk_alloc(size_t size, const H5O_pline_t *pline); -static void *H5D_chunk_xfree(void *chk, const H5O_pline_t *pline); -static void *H5D_chunk_realloc(void *chk, size_t size, +static void *H5D__chunk_alloc(size_t size, const H5O_pline_t *pline); +static void *H5D__chunk_xfree(void *chk, const H5O_pline_t *pline); +static void *H5D__chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline); -static herr_t H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, +static herr_t H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata); -static herr_t H5D_free_chunk_info(void *item, void *key, void *opdata); -static herr_t H5D_create_chunk_map_single(H5D_chunk_map_t *fm, +static hbool_t H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, + H5D_chunk_ud_t *udata); +static herr_t H5D__free_chunk_info(void *item, void *key, void *opdata); +static herr_t H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); -static herr_t H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, +static herr_t H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t *io_info); -static herr_t H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); -static herr_t H5D_chunk_file_cb(void *elem, hid_t type_id, unsigned ndims, +static herr_t H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm); +static herr_t H5D__chunk_file_cb(void *elem, hid_t type_id, unsigned ndims, const hsize_t *coords, void *fm); -static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, +static herr_t H5D__chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims, const hsize_t *coords, void *fm); -static herr_t H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, +static herr_t H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset); -static herr_t H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, +static herr_t H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t flush); +static herr_t H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, + const H5D_dxpl_cache_t *dxpl_cache, size_t size); +static herr_t H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata); /*********************/ @@ -224,20 +230,20 @@ static herr_t H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, /* Chunked storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_CHUNK[1] = {{ - H5D_chunk_construct, - H5D_chunk_init, - H5D_chunk_is_space_alloc, - H5D_chunk_io_init, - H5D_chunk_read, - H5D_chunk_write, + H5D__chunk_construct, + H5D__chunk_init, + H5D__chunk_is_space_alloc, + H5D__chunk_io_init, + H5D__chunk_read, + H5D__chunk_write, #ifdef H5_HAVE_PARALLEL - H5D_chunk_collective_read, - H5D_chunk_collective_write, + H5D__chunk_collective_read, + H5D__chunk_collective_write, #endif /* H5_HAVE_PARALLEL */ NULL, NULL, - H5D_chunk_flush, - H5D_chunk_io_term + H5D__chunk_flush, + H5D__chunk_io_term }}; @@ -257,7 +263,7 @@ const H5D_layout_ops_t H5D_LOPS_NONEXISTENT[1] = {{ NULL, NULL, #endif /* H5_HAVE_PARALLEL */ - H5D_nonexistent_readvv, + H5D__nonexistent_readvv, NULL, NULL, NULL @@ -278,7 +284,7 @@ H5FL_BLK_DEFINE_STATIC(chunk); /*------------------------------------------------------------------------- - * Function: H5D_chunk_set_info_real + * Function: H5D__chunk_set_info_real * * Purpose: Internal routine to set the information about chunks for a dataset * @@ -290,12 +296,12 @@ H5FL_BLK_DEFINE_STATIC(chunk); *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims) +H5D__chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_t *curr_dims) { unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(layout); @@ -317,11 +323,11 @@ H5D_chunk_set_info_real(H5O_layout_chunk_t *layout, unsigned ndims, const hsize_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_set_info_real() */ +} /* end H5D__chunk_set_info_real() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_set_info + * Function: H5D__chunk_set_info * * Purpose: Sets the information about chunks for a dataset * @@ -333,14 +339,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_set_info(const H5D_t *dset) +H5D__chunk_set_info(const H5D_t *dset) { hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /* Curr. size of dataset dimensions */ int sndims; /* Rank of dataspace */ unsigned ndims; /* Rank of dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity checks */ HDassert(dset); @@ -351,7 +357,7 @@ H5D_chunk_set_info(const H5D_t *dset) H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); /* Set the base layout information */ - if(H5D_chunk_set_info_real(&dset->shared->layout.u.chunk, ndims, curr_dims) < 0) + if(H5D__chunk_set_info_real(&dset->shared->layout.u.chunk, ndims, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") /* Call the index's "resize" callback */ @@ -360,11 +366,11 @@ H5D_chunk_set_info(const H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_set_info() */ +} /* end H5D__chunk_set_info() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_construct + * Function: H5D__chunk_construct * * Purpose: Constructs new chunked layout information for dataset * @@ -376,7 +382,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset) +H5D__chunk_construct(H5F_t UNUSED *f, H5D_t *dset) { const H5T_t *type = dset->shared->type; /* Convenience pointer to dataset's datatype */ hsize_t max_dims[H5O_LAYOUT_NDIMS]; /* Maximum size of data in elements */ @@ -386,7 +392,7 @@ H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -451,11 +457,11 @@ H5D_chunk_construct(H5F_t UNUSED *f, H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_construct() */ +} /* end H5D__chunk_construct() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_init + * Function: H5D__chunk_init * * Purpose: Initialize the raw data chunk cache for a dataset. This is * called when the dataset is initialized. @@ -468,14 +474,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) +H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Convenience pointer to dataset's chunk cache */ H5P_genplist_t *dapl; /* Data access property list object pointer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -509,7 +515,7 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Reset any cached chunk info for this dataset */ - H5D_chunk_cinfo_cache_reset(&(rdcc->last)); + H5D__chunk_cinfo_cache_reset(&(rdcc->last)); } /* end else */ /* Compose chunked index info struct */ @@ -524,16 +530,16 @@ H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize indexing information") /* Set the number of chunks in dataset, etc. */ - if(H5D_chunk_set_info(dset) < 0) + if(H5D__chunk_set_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set # of chunks for dataset") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_init() */ +} /* end H5D__chunk_init() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_is_space_alloc + * Function: H5D__chunk_is_space_alloc * * Purpose: Query if space is allocated for layout * @@ -545,11 +551,11 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D_chunk_is_space_alloc(const H5O_storage_t *storage) +H5D__chunk_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ HDassert(storage); @@ -558,11 +564,11 @@ H5D_chunk_is_space_alloc(const H5O_storage_t *storage) ret_value = (storage->u.chunk.ops->is_space_alloc)(&storage->u.chunk); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_is_space_alloc() */ +} /* end H5D__chunk_is_space_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_io_init + * Function: H5D__chunk_io_init * * Purpose: Performs initialization before any sort of I/O on the raw data * @@ -574,7 +580,7 @@ H5D_chunk_is_space_alloc(const H5O_storage_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm) { @@ -594,7 +600,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info hbool_t sel_hyper_flag; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get layout for dataset */ fm->layout = &(dataset->shared->layout); @@ -685,7 +691,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info fm->mchunk_tmpl = NULL; /* Set up chunk mapping for single element */ - if(H5D_create_chunk_map_single(fm, io_info) < 0) + if(H5D__create_chunk_map_single(fm, io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create chunk selections for single element") } /* end if */ else { @@ -715,7 +721,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info /* Check if file selection is a not a hyperslab selection */ if(sel_hyper_flag) { /* Build the file selection for each chunk */ - if(H5D_create_chunk_file_map_hyper(fm, io_info) < 0) + if(H5D__create_chunk_file_map_hyper(fm, io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") /* Clean file chunks' hyperslab span "scratch" information */ @@ -741,7 +747,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") /* Spaces might not be the same shape, iterate over the file selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm) < 0) + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_file_cb, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") /* Reset "last chunk" info */ @@ -757,7 +763,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info /* If the selections are the same shape, use the file chunk information * to generate the memory chunk information quickly. */ - if(H5D_create_chunk_mem_map_hyper(fm) < 0) + if(H5D__create_chunk_mem_map_hyper(fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") } /* end if */ else { @@ -788,7 +794,7 @@ H5D_chunk_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info iter_init = TRUE; /* Selection iteration info has been initialized */ /* Spaces aren't the same shape, iterate over the memory selection directly */ - if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_mem_cb, fm) < 0) + if(H5S_select_iterate(&bogus, f_tid, file_space, H5D__chunk_mem_cb, fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create memory chunk selections") /* Clean up hyperslab stuff, if necessary */ @@ -821,7 +827,7 @@ done: HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "can't release memory chunk dataspace template") } /* end if */ - if(H5D_chunk_io_term(fm) < 0) + if(H5D__chunk_io_term(fm) < 0) HDONE_ERROR(H5E_DATASPACE, H5E_CANTRELEASE, FAIL, "unable to release chunk mapping") } /* end if */ @@ -840,11 +846,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_io_init() */ +} /* end H5D__chunk_io_init() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_alloc + * Function: H5D__chunk_alloc * * Purpose: Allocate space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list @@ -858,11 +864,11 @@ done: *------------------------------------------------------------------------- */ static void * -H5D_chunk_alloc(size_t size, const H5O_pline_t *pline) +H5D__chunk_alloc(size_t size, const H5O_pline_t *pline) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(size); HDassert(pline); @@ -873,11 +879,11 @@ H5D_chunk_alloc(size_t size, const H5O_pline_t *pline) ret_value = H5FL_BLK_MALLOC(chunk, size); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_alloc() */ +} /* H5D__chunk_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_xfree + * Function: H5D__chunk_xfree * * Purpose: Free space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list @@ -891,9 +897,9 @@ H5D_chunk_alloc(size_t size, const H5O_pline_t *pline) *------------------------------------------------------------------------- */ static void * -H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) +H5D__chunk_xfree(void *chk, const H5O_pline_t *pline) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(pline); @@ -905,11 +911,11 @@ H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) } /* end if */ FUNC_LEAVE_NOAPI(NULL) -} /* H5D_chunk_xfree() */ +} /* H5D__chunk_xfree() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_realloc + * Function: H5D__chunk_realloc * * Purpose: Reallocate space for a chunk in memory. This routine allocates * memory space for non-filtered chunks from a block free list @@ -923,11 +929,11 @@ H5D_chunk_xfree(void *chk, const H5O_pline_t *pline) *------------------------------------------------------------------------- */ static void * -H5D_chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) +H5D__chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) { void *ret_value = NULL; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(size); HDassert(pline); @@ -938,16 +944,16 @@ H5D_chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) ret_value = H5FL_BLK_REALLOC(chunk, chk, size); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_realloc() */ +} /* H5D__chunk_realloc() */ /*-------------------------------------------------------------------------- NAME - H5D_free_chunk_info + H5D__free_chunk_info PURPOSE Internal routine to destroy a chunk info node USAGE - void H5D_free_chunk_info(chunk_info) + void H5D__free_chunk_info(chunk_info) void *chunk_info; IN: Pointer to chunk info to destroy RETURNS No return value @@ -959,11 +965,11 @@ H5D_chunk_realloc(void *chk, size_t size, const H5O_pline_t *pline) REVISION LOG --------------------------------------------------------------------------*/ static herr_t -H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) +H5D__free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) { H5D_chunk_info_t *chunk_info = (H5D_chunk_info_t *)item; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDassert(chunk_info); @@ -981,11 +987,11 @@ H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) chunk_info = H5FL_FREE(H5D_chunk_info_t, chunk_info); FUNC_LEAVE_NOAPI(0) -} /* H5D_free_chunk_info() */ +} /* H5D__free_chunk_info() */ /*------------------------------------------------------------------------- - * Function: H5D_create_chunk_map_single + * Function: H5D__create_chunk_map_single * * Purpose: Create chunk selections when appending a single record * @@ -997,7 +1003,7 @@ H5D_free_chunk_info(void *item, void UNUSED *key, void UNUSED *opdata) *------------------------------------------------------------------------- */ static herr_t -H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t +H5D__create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t #ifndef H5_HAVE_PARALLEL UNUSED #endif /* H5_HAVE_PARALLEL */ @@ -1009,7 +1015,7 @@ H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(fm->f_ndims > 0); @@ -1062,11 +1068,11 @@ H5D_create_chunk_map_single(H5D_chunk_map_t *fm, const H5D_io_info_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_map_single() */ +} /* end H5D__create_chunk_map_single() */ /*------------------------------------------------------------------------- - * Function: H5D_create_chunk_file_map_hyper + * Function: H5D__create_chunk_file_map_hyper * * Purpose: Create all chunk selections in file. * @@ -1078,7 +1084,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t +H5D__create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t #ifndef H5_HAVE_PARALLEL UNUSED #endif /* H5_HAVE_PARALLEL */ @@ -1095,7 +1101,7 @@ H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ assert(fm->f_ndims>0); @@ -1189,7 +1195,7 @@ H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t /* Insert the new chunk into the skip list */ if(H5SL_insert(fm->sel_chunks, new_chunk_info, &new_chunk_info->index) < 0) { - H5D_free_chunk_info(new_chunk_info, NULL, NULL); + H5D__free_chunk_info(new_chunk_info, NULL, NULL); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert chunk into skip list") } /* end if */ @@ -1240,11 +1246,11 @@ H5D_create_chunk_file_map_hyper(H5D_chunk_map_t *fm, const H5D_io_info_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_file_map_hyper() */ +} /* end H5D__create_chunk_file_map_hyper() */ /*------------------------------------------------------------------------- - * Function: H5D_create_chunk_mem_map_hyper + * Function: H5D__create_chunk_mem_map_hyper * * Purpose: Create all chunk selections in memory by copying the file * chunk selections and adjusting their offsets to be correct @@ -1260,7 +1266,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) +H5D__create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) { H5SL_node_t *curr_node; /* Current node in skip list */ hsize_t file_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */ @@ -1272,7 +1278,7 @@ H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ assert(fm->f_ndims>0); @@ -1352,11 +1358,11 @@ H5D_create_chunk_mem_map_hyper(const H5D_chunk_map_t *fm) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create_chunk_mem_map_hyper() */ +} /* end H5D__create_chunk_mem_map_hyper() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_file_cb + * Function: H5D__chunk_file_cb * * Purpose: Callback routine for file selection iterator. Used when * creating selections in file for each point selected. @@ -1369,7 +1375,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +H5D__chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) { H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ @@ -1378,7 +1384,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Calculate the index of this chunk */ if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) @@ -1441,7 +1447,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const /* Insert the new chunk into the skip list */ if(H5SL_insert(fm->sel_chunks,chunk_info,&chunk_info->index) < 0) { - H5D_free_chunk_info(chunk_info,NULL,NULL); + H5D__free_chunk_info(chunk_info,NULL,NULL); HGOTO_ERROR(H5E_DATASPACE,H5E_CANTINSERT,FAIL,"can't insert chunk into skip list") } /* end if */ } /* end if */ @@ -1464,11 +1470,11 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_file_cb() */ +} /* end H5D__chunk_file_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_mem_cb + * Function: H5D__chunk_mem_cb * * Purpose: Callback routine for file selection iterator. Used when * creating selections in memory for each chunk. @@ -1482,7 +1488,7 @@ done: */ /* ARGSUSED */ static herr_t -H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) +H5D__chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) { H5D_chunk_map_t *fm = (H5D_chunk_map_t *)_fm; /* File<->memory chunk mapping info */ H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */ @@ -1490,7 +1496,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t chunk_index; /* Chunk index */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Calculate the index of this chunk */ if(H5V_chunk_index(ndims, coords, fm->layout->u.chunk.dim, fm->layout->u.chunk.down_chunks, &chunk_index) < 0) @@ -1543,11 +1549,11 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_mem_cb() */ +} /* end H5D__chunk_mem_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_cacheable + * Function: H5D__chunk_cacheable * * Purpose: A small internal function to if it's possible to load the * chunk into cache. @@ -1560,12 +1566,12 @@ done: *------------------------------------------------------------------------- */ htri_t -H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op) +H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op) { const H5D_t *dataset = io_info->dset; htri_t ret_value = FAIL; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(io_info); HDassert(dataset); @@ -1617,11 +1623,11 @@ H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_o done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_cacheable() */ +} /* end H5D__chunk_cacheable() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_read + * Function: H5D__chunk_read * * Purpose: Read from a chunked dataset. * @@ -1633,7 +1639,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t *fm) { @@ -1648,7 +1654,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hbool_t skip_missing_chunks = FALSE; /* Whether to skip missing chunks */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(io_info); @@ -1705,7 +1711,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, chunk_info = H5D_CHUNK_GET_NODE_INFO(fm, chunk_node); /* Get the info for the chunk in the file */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") @@ -1713,7 +1719,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, if(H5F_addr_defined(udata.addr) || UINT_MAX != udata.idx_hint || !skip_missing_chunks) { /* Load the chunk into cache and lock it. */ - if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, FALSE)) < 0) + if((cacheable = H5D__chunk_cacheable(io_info, udata.addr, FALSE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") if(cacheable) { /* Pass in chunk's coordinates in a union. */ @@ -1725,7 +1731,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, src_accessed_bytes = chunk_info->chunk_points * (uint32_t)type_info->src_type_size; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, FALSE))) + if(NULL == (chunk = H5D__chunk_lock(io_info, &udata, FALSE))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1758,7 +1764,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked read failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) + if(chunk && H5D__chunk_unlock(io_info, &udata, FALSE, chunk, src_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ @@ -1768,11 +1774,11 @@ H5D_chunk_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_read() */ +} /* H5D__chunk_read() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_write + * Function: H5D__chunk_write * * Purpose: Writes to a chunked dataset. * @@ -1784,7 +1790,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t *fm) { @@ -1797,7 +1803,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, uint32_t dst_accessed_bytes = 0; /* Total accessed size in a chunk */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(io_info); @@ -1835,10 +1841,10 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, /* Load the chunk into cache. But if the whole chunk is written, * simply allocate space instead of load the chunk. */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") - if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, TRUE)) < 0) + if((cacheable = H5D__chunk_cacheable(io_info, udata.addr, TRUE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") if(cacheable) { hbool_t entire_chunk = TRUE; /* Whether whole chunk is selected */ @@ -1857,7 +1863,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk))) + if(NULL == (chunk = H5D__chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1890,7 +1896,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "chunk address isn't defined") /* Cache the new chunk information */ - H5D_chunk_cinfo_cache_update(&io_info->dset->shared->cache.chunk.last, &udata); + H5D__chunk_cinfo_cache_update(&io_info->dset->shared->cache.chunk.last, &udata); } /* end if */ /* Set up the storage address information for this chunk */ @@ -1909,7 +1915,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "chunked write failed") /* Release the cache lock on the chunk. */ - if(chunk && H5D_chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) + if(chunk && H5D__chunk_unlock(io_info, &udata, TRUE, chunk, dst_accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") /* Advance to next chunk in list */ @@ -1918,11 +1924,11 @@ H5D_chunk_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_write() */ +} /* H5D__chunk_write() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_flush + * Function: H5D__chunk_flush * * Purpose: Writes all dirty chunks to disk and optionally preempts them * from the cache. @@ -1935,7 +1941,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_flush(H5D_t *dset, hid_t dxpl_id) { H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ @@ -1944,23 +1950,23 @@ H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id) unsigned nerrors = 0; /* Count of any errors encountered when flushing chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(dset); /* Flush any data caught in sieve buffer */ - if(H5D_flush_sieve_buf(dset, dxpl_id) < 0) + if(H5D__flush_sieve_buf(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer") /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Loop over all entries in the chunk cache */ for(ent = rdcc->head; ent; ent = next) { next = ent->next; - if(H5D_chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) nerrors++; } /* end for */ if(nerrors) @@ -1968,11 +1974,11 @@ H5D_chunk_flush(H5D_t *dset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_flush() */ +} /* end H5D__chunk_flush() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_io_term + * Function: H5D__chunk_io_term * * Purpose: Destroy I/O operation information. * @@ -1984,11 +1990,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_io_term(const H5D_chunk_map_t *fm) +H5D__chunk_io_term(const H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Single element I/O vs. multiple element I/O cleanup */ if(fm->use_single) { @@ -2004,7 +2010,7 @@ H5D_chunk_io_term(const H5D_chunk_map_t *fm) else { /* Release the nodes on the list of selected chunks */ if(fm->sel_chunks) - if(H5SL_free(fm->sel_chunks, H5D_free_chunk_info, NULL) < 0) + if(H5SL_free(fm->sel_chunks, H5D__free_chunk_info, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTNEXT, FAIL, "can't iterate over chunks") } /* end else */ @@ -2019,7 +2025,7 @@ H5D_chunk_io_term(const H5D_chunk_map_t *fm) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_io_term() */ +} /* end H5D__chunk_io_term() */ /*------------------------------------------------------------------------- @@ -2055,7 +2061,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_chunk_cinfo_cache_reset + * Function: H5D__chunk_cinfo_cache_reset * * Purpose: Reset the cached chunk info * @@ -2067,9 +2073,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) +H5D__chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity check */ HDassert(last); @@ -2078,11 +2084,11 @@ H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) last->valid = FALSE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5D_chunk_cinfo_cache_reset() */ +} /* H5D__chunk_cinfo_cache_reset() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_cinfo_cache_update + * Function: H5D__chunk_cinfo_cache_update * * Purpose: Update the cached chunk info * @@ -2094,11 +2100,11 @@ H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last) *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata) +H5D__chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *udata) { unsigned u; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(last); @@ -2118,11 +2124,11 @@ H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *uda last->valid = TRUE; FUNC_LEAVE_NOAPI(SUCCEED) -} /* H5D_chunk_cinfo_cache_update() */ +} /* H5D__chunk_cinfo_cache_update() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_cinfo_cache_found + * Function: H5D__chunk_cinfo_cache_found * * Purpose: Look for chunk info in cache * @@ -2134,11 +2140,11 @@ H5D_chunk_cinfo_cache_update(H5D_chunk_cached_t *last, const H5D_chunk_ud_t *uda *------------------------------------------------------------------------- */ static hbool_t -H5D_chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata) +H5D__chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udata) { hbool_t ret_value = FALSE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(last); @@ -2167,11 +2173,11 @@ H5D_chunk_cinfo_cache_found(const H5D_chunk_cached_t *last, H5D_chunk_ud_t *udat done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_cinfo_cache_found() */ +} /* H5D__chunk_cinfo_cache_found() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_create + * Function: H5D__chunk_create * * Purpose: Creates a new chunked storage index and initializes the * layout information with information about the storage. The @@ -2186,12 +2192,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) +H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dset); @@ -2219,11 +2225,11 @@ H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_create() */ +} /* end H5D__chunk_create() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_lookup + * Function: H5D__chunk_lookup * * Purpose: Loops up a chunk in cache and on disk, and retrieves * information about that chunk. @@ -2236,7 +2242,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, +H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, hsize_t chunk_idx, H5D_chunk_ud_t *udata) { H5D_rdcc_ent_t *ent = NULL; /* Cache entry */ @@ -2244,7 +2250,7 @@ H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, unsigned u; /* Counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(dset); HDassert(dset->shared->layout.u.chunk.ndims > 0); @@ -2284,7 +2290,7 @@ H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, udata->idx_hint = UINT_MAX; /* Check for cached information */ - if(!H5D_chunk_cinfo_cache_found(&dset->shared->cache.chunk.last, udata)) { + if(!H5D__chunk_cinfo_cache_found(&dset->shared->cache.chunk.last, udata)) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ /* Compose chunked index info struct */ @@ -2299,17 +2305,17 @@ H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't query chunk address") /* Cache the information retrieved */ - H5D_chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); + H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, udata); } /* end if */ } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_lookup() */ +} /* H5D__chunk_lookup() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_flush_entry + * Function: H5D__chunk_flush_entry * * Purpose: Writes a chunk to disk. If RESET is non-zero then the * entry is cleared -- it's slightly faster to flush a chunk if @@ -2324,14 +2330,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, +H5D__chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t reset) { void *buf = NULL; /* Temporary buffer */ hbool_t point_of_no_return = FALSE; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dxpl_id, dset->oloc.addr, FAIL) HDassert(dset); HDassert(dset->shared); @@ -2427,7 +2433,7 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write raw data to file") /* Cache the chunk's info, in case it's accessed again shortly */ - H5D_chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, &udata); + H5D__chunk_cinfo_cache_update(&dset->shared->cache.chunk.last, &udata); /* Mark cache entry as clean */ ent->dirty = FALSE; @@ -2442,7 +2448,7 @@ H5D_chunk_flush_entry(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * if(buf == ent->chunk) buf = NULL; if(ent->chunk != NULL) - ent->chunk = (uint8_t *)H5D_chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); + ent->chunk = (uint8_t *)H5D__chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); } /* end if */ done: @@ -2458,15 +2464,15 @@ done: */ if(ret_value < 0 && point_of_no_return) { if(ent->chunk) - ent->chunk = (uint8_t *)H5D_chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); + ent->chunk = (uint8_t *)H5D__chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_chunk_flush_entry() */ +} /* end H5D__chunk_flush_entry() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_cache_evict + * Function: H5D__chunk_cache_evict * * Purpose: Preempts the specified entry from the cache, flushing it to * disk if necessary. @@ -2479,13 +2485,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, +H5D__chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, H5D_rdcc_ent_t *ent, hbool_t flush) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(dset); HDassert(dxpl_cache); @@ -2495,13 +2501,13 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * if(flush) { /* Flush */ - if(H5D_chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) HDONE_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { /* Don't flush, just free chunk */ if(ent->chunk != NULL) - ent->chunk = (uint8_t *)H5D_chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); + ent->chunk = (uint8_t *)H5D__chunk_xfree(ent->chunk, &(dset->shared->dcpl_cache.pline)); } /* end else */ /* Unlink from list */ @@ -2525,11 +2531,11 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * ent = H5FL_FREE(H5D_rdcc_ent_t, ent); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_cache_evict() */ +} /* end H5D__chunk_cache_evict() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_cache_prune + * Function: H5D__chunk_cache_prune * * Purpose: Prune the cache by preempting some things until the cache has * room for something which is SIZE bytes. Only unlocked @@ -2543,7 +2549,7 @@ H5D_chunk_cache_evict(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t * *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, +H5D__chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, const H5D_dxpl_cache_t *dxpl_cache, size_t size) { const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); @@ -2555,7 +2561,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, int nerrors = 0; /* Accumulated error count during preemptions */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* * Preemption is accomplished by having multiple pointers (currently two) @@ -2616,7 +2622,7 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, if(n[j] == cur) n[j] = cur->next; } /* end for */ - if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, cur, TRUE) < 0) nerrors++; } /* end if */ } /* end for */ @@ -2633,17 +2639,17 @@ H5D_chunk_cache_prune(const H5D_t *dset, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_cache_prune() */ +} /* end H5D__chunk_cache_prune() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_lock + * Function: H5D__chunk_lock * * Purpose: Return a pointer to a dataset chunk. The pointer points * directly into the chunk cache and should not be freed * by the caller but will be valid until it is unlocked. The * input value IDX_HINT is used to speed up cache lookups and - * it's output value should be given to H5D_chunk_unlock(). + * it's output value should be given to H5D__chunk_unlock(). * IDX_HINT is ignored if it is out of range, and if it points * to the wrong entry then we fall back to the normal search * method. @@ -2664,11 +2670,11 @@ done: *------------------------------------------------------------------------- */ void * -H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, +H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax) { H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ - const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info - always equal to the pline passed to H5D_chunk_alloc */ + const H5O_pline_t *pline = &(dset->shared->dcpl_cache.pline); /* I/O pipeline info - always equal to the pline passed to H5D__chunk_alloc */ const H5O_layout_t *layout = &(dset->shared->layout); /* Dataset layout */ const H5O_fill_t *fill = &(dset->shared->dcpl_cache.fill); /* Fill value info */ H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ @@ -2681,7 +2687,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, unsigned u; /*counters */ void *ret_value; /*return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE HDassert(io_info); HDassert(io_info->dxpl_cache); @@ -2726,7 +2732,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Still save the chunk address so the cache stays consistent */ chunk_addr = udata->addr; - if(NULL == (chunk = H5D_chunk_alloc(chunk_size, pline))) + if(NULL == (chunk = H5D__chunk_alloc(chunk_size, pline))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") /* In the case that some dataset functions look through this data, @@ -2749,7 +2755,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ H5_ASSIGN_OVERFLOW(chunk_alloc, udata->nbytes, uint32_t, size_t); - if(NULL == (chunk = H5D_chunk_alloc(chunk_alloc, pline))) + if(NULL == (chunk = H5D__chunk_alloc(chunk_alloc, pline))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") if(H5F_block_read(dset->oloc.file, H5FD_MEM_DRAW, chunk_addr, chunk_alloc, io_info->dxpl_id, chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") @@ -2772,7 +2778,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Chunk size on disk isn't [likely] the same size as the final chunk * size in memory, so allocate memory big enough. */ - if(NULL == (chunk = H5D_chunk_alloc(chunk_size, pline))) + if(NULL == (chunk = H5D__chunk_alloc(chunk_size, pline))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") if(H5P_is_fill_value_defined(fill, &fill_status) < 0) @@ -2787,7 +2793,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ - if(H5D_fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, + if(H5D__fill_init(&fb_info, chunk, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, chunk_size, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't initialize fill buffer info") @@ -2796,7 +2802,7 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, NULL, "can't refill fill value buffer") } /* end if */ else @@ -2839,10 +2845,10 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, if(!ent || !ent->locked) { /* Preempt enough things from the cache to make room */ if(ent) { - if(H5D_chunk_cache_evict(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache") } /* end if */ - if(H5D_chunk_cache_prune(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, chunk_size) < 0) + if(H5D__chunk_cache_prune(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, chunk_size) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache") /* Create a new entry */ @@ -2903,23 +2909,23 @@ H5D_chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, done: /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) + if(fb_info_init && H5D__fill_term(&fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, NULL, "Can't release fill buffer info") /* Release the chunk allocated, on error */ if(!ret_value) if(chunk) - chunk = H5D_chunk_xfree(chunk, pline); + chunk = H5D__chunk_xfree(chunk, pline); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_lock() */ +} /* end H5D__chunk_lock() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_unlock + * Function: H5D__chunk_unlock * * Purpose: Unlocks a previously locked chunk. The LAYOUT, COMP, and - * OFFSET arguments should be the same as for H5D_chunk_lock(). + * OFFSET arguments should be the same as for H5D__chunk_lock(). * The DIRTY argument should be set to non-zero if the chunk has * been modified since it was locked. The IDX_HINT argument is * the returned index hint from the lock operation and BUF is @@ -2938,14 +2944,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, +H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed) { const H5O_layout_t *layout = &(io_info->dset->shared->layout); /* Dataset layout */ const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(io_info); HDassert(udata); @@ -2967,12 +2973,12 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, fake_ent.chunk_addr = udata->addr; fake_ent.chunk = (uint8_t *)chunk; - if(H5D_chunk_flush_entry(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, &fake_ent, TRUE) < 0) + if(H5D__chunk_flush_entry(io_info->dset, io_info->dxpl_id, io_info->dxpl_cache, &fake_ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end if */ else { if(chunk) - chunk = H5D_chunk_xfree(chunk, &(io_info->dset->shared->dcpl_cache.pline)); + chunk = H5D__chunk_xfree(chunk, &(io_info->dset->shared->dcpl_cache.pline)); } /* end else */ } /* end if */ else { @@ -2999,11 +3005,11 @@ H5D_chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_unlock() */ +} /* end H5D__chunk_unlock() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_allocated_cb + * Function: H5D__chunk_allocated_cb * * Purpose: Simply counts the number of chunks for a dataset. * @@ -3017,20 +3023,20 @@ done: */ /* ARGSUSED */ static int -H5D_chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) +H5D__chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { hsize_t *nbytes = (hsize_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR *(hsize_t *)nbytes += chunk_rec->nbytes; FUNC_LEAVE_NOAPI(H5_ITER_CONT) -} /* H5D_chunk_allocated_cb() */ +} /* H5D__chunk_allocated_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_allocated + * Function: H5D__chunk_allocated * * Purpose: Return the number of bytes allocated in the file for storage * of raw data in the chunked dataset @@ -3044,7 +3050,7 @@ H5D_chunk_allocated_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) +H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /* Raw data chunk cache */ @@ -3054,19 +3060,19 @@ H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) hsize_t chunk_bytes = 0; /* Number of bytes allocated for chunks */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(dset); HDassert(dset->shared); /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Search for cached chunks that haven't been written out */ for(ent = rdcc->head; ent; ent = ent->next) { /* Flush the chunk out to disk, to make certain the size is correct later */ - if(H5D_chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) + if(H5D__chunk_flush_entry(dset, dxpl_id, dxpl_cache, ent, FALSE) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer") } /* end for */ @@ -3078,7 +3084,7 @@ H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) idx_info.storage = &dset->shared->layout.storage.u.chunk; /* Iterate over the chunks */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D_chunk_allocated_cb, &chunk_bytes) < 0) + if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_allocated_cb, &chunk_bytes) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to retrieve allocated chunk information from index") /* Set number of bytes for caller */ @@ -3086,11 +3092,11 @@ H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_allocated() */ +} /* end H5D__chunk_allocated() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_allocate + * Function: H5D__chunk_allocate * * Purpose: Allocate file space for all chunks that are not allocated yet. * Return SUCCEED if all needed allocation succeed, otherwise @@ -3104,7 +3110,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, +H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ @@ -3138,7 +3144,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hid_t data_dxpl_id; /* DXPL ID to use for raw data I/O operations */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -3158,7 +3164,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, for(op_dim=0; op_dimshared->cache.chunk.last); + H5D__chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); HGOTO_DONE(SUCCEED) } /* end if */ @@ -3188,7 +3194,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, #endif /* H5_HAVE_PARALLEL */ /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(data_dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(data_dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Get original chunk size */ @@ -3213,8 +3219,8 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, /* Initialize the fill value buffer */ /* (delay allocating fill buffer for VL datatypes until refilling) */ /* (casting away const OK - QAK) */ - if(H5D_fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D_chunk_alloc, - (void *)pline, (H5MM_free_t)H5D_chunk_xfree, (void *)pline, + if(H5D__fill_init(&fb_info, NULL, (H5MM_allocate_t)H5D__chunk_alloc, + (void *)pline, (H5MM_free_t)H5D__chunk_xfree, (void *)pline, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, orig_chunk_size, data_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") @@ -3303,7 +3309,7 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, &chunk_idx) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't get chunk index") - if(H5D_chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chunk_idx, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") @@ -3332,14 +3338,14 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, * possible (though ill-advised) for the filter to shrink the * buffer. */ if(fb_info.fill_buf_size < orig_chunk_size) { - if(NULL == (fb_info.fill_buf = H5D_chunk_realloc( + if(NULL == (fb_info.fill_buf = H5D__chunk_realloc( fb_info.fill_buf, orig_chunk_size, pline))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory reallocation failed for raw data chunk") fb_info.fill_buf_size = orig_chunk_size; } /* end if */ /* Fill the buffer with VL datatype fill values */ - if(H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, data_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, data_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Check if there are filters which need to be applied to the chunk */ @@ -3441,19 +3447,19 @@ H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, #endif /* H5_HAVE_PARALLEL */ /* Reset any cached chunk info for this dataset */ - H5D_chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); + H5D__chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); done: /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) + if(fb_info_init && H5D__fill_term(&fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_chunk_allocate() */ +} /* end H5D__chunk_allocate() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_prune_fill + * Function: H5D__chunk_prune_fill * * Purpose: Write the fill value to the parts of the chunk that are no * longer part of the dataspace @@ -3466,7 +3472,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) +H5D__chunk_prune_fill(H5D_chunk_it_ud1_t *udata) { const H5D_io_info_t *io_info = udata->io_info; /* Local pointer to I/O info */ H5D_t *dset = io_info->dset; /* Local pointer to the dataset info */ @@ -3484,14 +3490,14 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the chunk's size */ HDassert(layout->u.chunk.size > 0); H5_ASSIGN_OVERFLOW(chunk_size, layout->u.chunk.size, uint32_t, size_t); /* Get the info for the chunk in the file */ - if(H5D_chunk_lookup(dset, io_info->dxpl_id, chunk_offset, + if(H5D__chunk_lookup(dset, io_info->dxpl_id, chunk_offset, io_info->store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk address") @@ -3503,7 +3509,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) /* Initialize the fill value buffer, if necessary */ if(!udata->fb_info_init) { H5_CHECK_OVERFLOW(udata->elmts_per_chunk, uint32_t, size_t); - if(H5D_fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, + if(H5D__fill_init(&udata->fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)udata->elmts_per_chunk, chunk_size, io_info->dxpl_id) < 0) @@ -3527,7 +3533,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) HGOTO_ERROR(H5E_DATASET, H5E_CANTSELECT, FAIL, "unable to select hyperslab") /* Lock the chunk into the cache, to get a pointer to the chunk buffer */ - if(NULL == (chunk = (void *)H5D_chunk_lock(io_info, &chk_udata, FALSE))) + if(NULL == (chunk = (void *)H5D__chunk_lock(io_info, &chk_udata, FALSE))) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "unable to lock raw data chunk") @@ -3544,7 +3550,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) /* Check for VL datatype & non-default fill value */ if(udata->fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D_fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts, io_info->dxpl_id) < 0) + if(H5D__fill_refill_vl(&udata->fb_info, (size_t)sel_nelmts, io_info->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") /* Create a selection iterator for scattering the elements to memory buffer */ @@ -3553,7 +3559,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) chunk_iter_init = TRUE; /* Scatter the data into memory */ - if(H5D_scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, &chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) + if(H5D__scatter_mem(udata->fb_info.fill_buf, udata->chunk_space, &chunk_iter, (size_t)sel_nelmts, io_info->dxpl_cache, chunk/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") @@ -3563,7 +3569,7 @@ H5D_chunk_prune_fill(H5D_chunk_it_ud1_t *udata) bytes_accessed = (uint32_t)sel_nelmts * layout->u.chunk.dim[rank]; /* Release lock on chunk */ - if(H5D_chunk_unlock(io_info, &chk_udata, TRUE, chunk, bytes_accessed) < 0) + if(H5D__chunk_unlock(io_info, &chk_udata, TRUE, chunk, bytes_accessed) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk") done: @@ -3572,11 +3578,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_prune_fill */ +} /* H5D__chunk_prune_fill */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_prune_by_extent + * Function: H5D__chunk_prune_by_extent * * Purpose: This function searches for chunks that are no longer necessary * both in the raw data cache and in the chunk index. @@ -3675,7 +3681,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) +H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) { hsize_t min_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of first chunk to modify in each dimension */ hsize_t max_mod_chunk_off[H5O_LAYOUT_NDIMS]; /* Offset of last chunk to modify in each dimension */ @@ -3709,7 +3715,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dset && H5D_CHUNKED == layout->type); @@ -3717,7 +3723,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDassert(dxpl_cache); /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Go get the rank & dimensions (including the element size) */ @@ -3733,7 +3739,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) for(op_dim=0; op_dimshared->cache.chunk.last); + H5D__chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); HGOTO_DONE(SUCCEED) } /* end if */ @@ -3880,7 +3886,7 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) HDassert(chunk_offset[op_dim] == min_mod_chunk_off[op_dim]); /* Fill the unused parts of the chunk */ - if(H5D_chunk_prune_fill(&udata) < 0) + if(H5D__chunk_prune_fill(&udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to write fill value") } /* end if */ else { @@ -3899,14 +3905,14 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) #endif /* NDEBUG */ /* Check if the chunk exists in cache or on disk */ - if(H5D_chunk_lookup(dset, dxpl_id, chunk_offset, + if(H5D__chunk_lookup(dset, dxpl_id, chunk_offset, chk_io_info.store->chunk.index, &chk_udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "error looking up chunk") /* Evict the entry from the cache if present, but do not flush * it to disk */ if(UINT_MAX != chk_udata.idx_hint) { - if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, rdcc->slot[chk_udata.idx_hint], FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTREMOVE, FAIL, "unable to evict chunk") } /* end if */ @@ -3971,24 +3977,24 @@ H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim) } /* end for(op_dim=0...) */ /* Reset any cached chunk info for this dataset */ - H5D_chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); + H5D__chunk_cinfo_cache_reset(&dset->shared->cache.chunk.last); done: /* Release resources */ if(chunk_space && H5S_close(chunk_space) < 0) HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace") if(udata_init) { - if(udata.fb_info_init && H5D_fill_term(&udata.fb_info) < 0) + if(udata.fb_info_init && H5D__fill_term(&udata.fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_prune_by_extent() */ +} /* end H5D__chunk_prune_by_extent() */ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5D_chunk_addrmap_cb + * Function: H5D__chunk_addrmap_cb * * Purpose: Callback when obtaining the chunk addresses for all existing chunks * @@ -4001,14 +4007,14 @@ done: *------------------------------------------------------------------------- */ static int -H5D_chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) +H5D__chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_it_ud2_t *udata = (H5D_chunk_it_ud2_t *)_udata; /* User data for callback */ unsigned rank = udata->common.layout->ndims - 1; /* # of dimensions of dataset */ hsize_t chunk_index; int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Compute the index for this chunk */ if(H5V_chunk_index(rank, chunk_rec->offset, udata->common.layout->dim, udata->common.layout->down_chunks, &chunk_index) < 0) @@ -4019,11 +4025,11 @@ H5D_chunk_addrmap_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_chunk_addrmap_cb() */ +} /* H5D__chunk_addrmap_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_addrmap + * Function: H5D__chunk_addrmap * * Purpose: Obtain the chunk addresses for all existing chunks * @@ -4036,14 +4042,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) +H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_t *dset = io_info->dset; /* Local pointer to dataset info */ H5D_chunk_it_ud2_t udata; /* User data for iteration callback */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(dset); HDassert(dset->shared); @@ -4064,17 +4070,17 @@ H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]) idx_info.storage = &dset->shared->layout.storage.u.chunk; /* Iterate over chunks to build mapping of chunk addresses */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D_chunk_addrmap_cb, &udata) < 0) + if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_addrmap_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "unable to iterate over chunk index to build address map") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_addrmap() */ +} /* end H5D__chunk_addrmap() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_delete + * Function: H5D__chunk_delete * * Purpose: Delete raw data storage for entire dataset (i.e. all chunks) * @@ -4087,7 +4093,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) +H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5O_layout_t layout; /* Dataset layout message */ @@ -4097,7 +4103,7 @@ H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_storage_t *storage) htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(f); @@ -4147,11 +4153,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset layout message") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_delete() */ +} /* end H5D__chunk_delete() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_update_cache + * Function: H5D__chunk_update_cache * * Purpose: Update any cached chunks index values after the dataspace * size has changed @@ -4165,7 +4171,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) +H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */ H5D_rdcc_ent_t *ent, *next; /*cache entry */ @@ -4175,7 +4181,7 @@ H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) unsigned rank; /*current # of dimensions */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dset && H5D_CHUNKED == dset->shared->layout.type); @@ -4190,7 +4196,7 @@ H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) HGOTO_DONE(SUCCEED) /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Recompute the index for each cached chunk that is in a dataset */ @@ -4220,7 +4226,7 @@ H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) next = old_ent->next; /* Remove the old entry from the cache */ - if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, old_ent, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, old_ent, TRUE) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") } /* end if */ @@ -4234,11 +4240,11 @@ H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_update_cache() */ +} /* end H5D__chunk_update_cache() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_copy_cb + * Function: H5D__chunk_copy_cb * * Purpose: Copy chunked raw data from source file and insert to the * index in the destination file @@ -4251,7 +4257,7 @@ done: *------------------------------------------------------------------------- */ static int -H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) +H5D__chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_it_ud3_t *udata = (H5D_chunk_it_ud3_t *)_udata; /* User data for callback */ H5D_chunk_ud_t udata_dst; /* User data about new destination chunk */ @@ -4271,7 +4277,7 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get 'size_t' local value for number of bytes in chunk */ H5_ASSIGN_OVERFLOW(nbytes, chunk_rec->nbytes, uint32_t, size_t); @@ -4414,11 +4420,11 @@ H5D_chunk_copy_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_copy_cb() */ +} /* end H5D__chunk_copy_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_copy + * Function: H5D__chunk_copy * * Purpose: Copy chunked storage from SRC file to DST file. * @@ -4431,7 +4437,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, +H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id) @@ -4457,7 +4463,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, hbool_t copy_setup_done = FALSE; /* Indicate that 'copy setup' is done */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f_src); @@ -4492,7 +4498,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5_ASSIGN_OVERFLOW(ndims, sndims, int, unsigned); /* Set the source layout chunk information */ - if(H5D_chunk_set_info_real(layout_src, ndims, curr_dims) < 0) + if(H5D__chunk_set_info_real(layout_src, ndims, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't set layout's chunk info") } /* end block */ @@ -4643,7 +4649,7 @@ H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, udata.cpy_info = cpy_info; /* Iterate over chunks to copy data */ - if((storage_src->ops->iterate)(&idx_info_src, H5D_chunk_copy_cb, &udata) < 0) + if((storage_src->ops->iterate)(&idx_info_src, H5D__chunk_copy_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to copy data") /* I/O buffers may have been re-allocated */ @@ -4672,11 +4678,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to shut down index copying info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_copy() */ +} /* end H5D__chunk_copy() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_bh_info + * Function: H5D__chunk_bh_info * * Purpose: Retrieve the amount of index storage for chunked dataset * @@ -4689,13 +4695,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, +H5D__chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, const H5O_pline_t *pline, hsize_t *index_size) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -4716,11 +4722,11 @@ H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_bh_info() */ +} /* end H5D__chunk_bh_info() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_iter_dump + * Function: H5D__chunk_dump_index_cb * * Purpose: If the UDATA.STREAM member is non-null then debugging * information is written to that stream. @@ -4736,11 +4742,11 @@ done: */ /* ARGSUSED */ static int -H5D_chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) +H5D__chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) { H5D_chunk_it_ud4_t *udata = (H5D_chunk_it_ud4_t *)_udata; /* User data from caller */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR if(udata->stream) { unsigned u; /* Local index variable */ @@ -4762,11 +4768,11 @@ H5D_chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) } /* end if */ FUNC_LEAVE_NOAPI(H5_ITER_CONT) -} /* H5D_chunk_dump_index_cb() */ +} /* H5D__chunk_dump_index_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_dump_index + * Function: H5D__chunk_dump_index * * Purpose: Prints information about the storage index to the specified * stream. @@ -4780,11 +4786,11 @@ H5D_chunk_dump_index_cb(const H5D_chunk_rec_t *chunk_rec, void *_udata) *------------------------------------------------------------------------- */ herr_t -H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) +H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(dset); @@ -4811,17 +4817,17 @@ H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream) udata.ndims = dset->shared->layout.u.chunk.ndims; /* Iterate over index and dump chunk info */ - if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D_chunk_dump_index_cb, &udata) < 0) + if((dset->shared->layout.storage.u.chunk.ops->iterate)(&idx_info, H5D__chunk_dump_index_cb, &udata) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to iterate over chunk index to dump chunk info") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_dump_index() */ +} /* end H5D__chunk_dump_index() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_dest + * Function: H5D__chunk_dest * * Purpose: Destroy the entire chunk cache by flushing dirty entries, * preempting all entries, and freeing the cache itself. @@ -4834,7 +4840,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) +H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) { H5D_chk_idx_info_t idx_info; /* Chunked index info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ @@ -4844,19 +4850,19 @@ H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) int nerrors = 0; /* Accumulated count of errors */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) HDassert(f); HDassert(dset); /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Flush all the cached chunks */ for(ent = rdcc->head; ent; ent = next) { next = ent->next; - if(H5D_chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) + if(H5D__chunk_cache_evict(dset, dxpl_id, dxpl_cache, ent, TRUE) < 0) nerrors++; } /* end for */ @@ -4882,12 +4888,12 @@ H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset) done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_chunk_dest() */ +} /* end H5D__chunk_dest() */ #ifdef H5D_CHUNK_DEBUG /*------------------------------------------------------------------------- - * Function: H5D_chunk_stats + * Function: H5D__chunk_stats * * Purpose: Print raw data cache statistics to the debug stream. If * HEADERS is non-zero then print table column headers, @@ -4901,14 +4907,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_stats(const H5D_t *dset, hbool_t headers) +H5D__chunk_stats(const H5D_t *dset, hbool_t headers) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); double miss_rate; char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOERR(FAIL) + FUNC_ENTER_PACKAGE_NOERR if (!H5DEBUG(AC)) HGOTO_DONE(SUCCEED) @@ -4945,12 +4951,12 @@ H5D_chunk_stats(const H5D_t *dset, hbool_t headers) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_stats() */ +} /* end H5D__chunk_stats() */ #endif /* H5D_CHUNK_DEBUG */ /*------------------------------------------------------------------------- - * Function: H5D_nonexistent_readvv_cb + * Function: H5D__nonexistent_readvv_cb * * Purpose: Callback operation for performing fill value I/O operation * on memory buffer. @@ -4968,7 +4974,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, +H5D__nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_chunk_readvv_ud_t *udata = (H5D_chunk_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ @@ -4976,30 +4982,30 @@ H5D_nonexistent_readvv_cb(hsize_t UNUSED dst_off, hsize_t src_off, size_t len, hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Initialize the fill value buffer */ - if(H5D_fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, + if(H5D__fill_init(&fb_info, (udata->rbuf + src_off), NULL, NULL, NULL, NULL, &udata->dset->shared->dcpl_cache.fill, udata->dset->shared->type, udata->dset->shared->type_id, (size_t)0, len, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize fill buffer info") fb_info_init = TRUE; /* Check for VL datatype & fill the buffer with VL datatype fill values */ - if(fb_info.has_vlen_fill_type && H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, udata->dxpl_id) < 0) + if(fb_info.has_vlen_fill_type && H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) + if(fb_info_init && H5D__fill_term(&fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_nonexistent_readvv_cb() */ +} /* H5D__nonexistent_readvv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_nonexistent_readvv + * Function: H5D__nonexistent_readvv * * Purpose: When the chunk doesn't exist on disk and the chunk is bigger * than the cache size, performs fill value I/O operation on @@ -5019,14 +5025,14 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_nonexistent_readvv(const H5D_io_info_t *io_info, +H5D__nonexistent_readvv(const H5D_io_info_t *io_info, size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_chunk_readvv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -5045,10 +5051,10 @@ H5D_nonexistent_readvv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_nonexistent_readvv_cb, &udata)) < 0) + H5D__nonexistent_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized fill value init") done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_nonexistent_readvv() */ +} /* H5D__nonexistent_readvv() */ diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index 33a0dd6..c692c2b 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -58,18 +58,18 @@ /********************/ /* Layout operation callbacks */ -static herr_t H5D_compact_construct(H5F_t *f, H5D_t *dset); -static hbool_t H5D_compact_is_space_alloc(const H5O_storage_t *storage); -static herr_t H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +static herr_t H5D__compact_construct(H5F_t *f, H5D_t *dset); +static hbool_t H5D__compact_is_space_alloc(const H5O_storage_t *storage); +static herr_t H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); -static ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, +static ssize_t H5D__compact_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, +static ssize_t H5D__compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D_compact_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__compact_flush(H5D_t *dset, hid_t dxpl_id); /*********************/ @@ -78,19 +78,19 @@ static herr_t H5D_compact_flush(H5D_t *dset, hid_t dxpl_id); /* Compact storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_COMPACT[1] = {{ - H5D_compact_construct, + H5D__compact_construct, NULL, - H5D_compact_is_space_alloc, - H5D_compact_io_init, - H5D_contig_read, - H5D_contig_write, + H5D__compact_is_space_alloc, + H5D__compact_io_init, + H5D__contig_read, + H5D__contig_write, #ifdef H5_HAVE_PARALLEL NULL, NULL, #endif /* H5_HAVE_PARALLEL */ - H5D_compact_readvv, - H5D_compact_writevv, - H5D_compact_flush, + H5D__compact_readvv, + H5D__compact_writevv, + H5D__compact_flush, NULL }}; @@ -105,7 +105,7 @@ H5FL_BLK_EXTERN(type_conv); /*------------------------------------------------------------------------- - * Function: H5D_compact_fill + * Function: H5D__compact_fill * * Purpose: Write fill values to a compactly stored dataset. * @@ -117,13 +117,13 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) +H5D__compact_fill(H5D_t *dset, hid_t dxpl_id) { H5D_fill_buf_info_t fb_info; /* Dataset's fill buffer info */ hbool_t fb_info_init = FALSE; /* Whether the fill value buffer has been initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); @@ -134,7 +134,7 @@ H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) /* Initialize the fill value buffer */ /* (use the compact dataset storage buffer as the fill value buffer) */ - if(H5D_fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, + if(H5D__fill_init(&fb_info, dset->shared->layout.storage.u.compact.buf, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, (size_t)0, dset->shared->layout.storage.u.compact.size, dxpl_id) < 0) @@ -144,20 +144,20 @@ H5D_compact_fill(H5D_t *dset, hid_t dxpl_id) /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Fill the buffer with VL datatype fill values */ - if(H5D_fill_refill_vl(&fb_info, fb_info.elmts_per_buf, dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, fb_info.elmts_per_buf, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") done: /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) + if(fb_info_init && H5D__fill_term(&fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_fill() */ +} /* end H5D__compact_fill() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_construct + * Function: H5D__compact_construct * * Purpose: Constructs new compact layout information for dataset * @@ -169,7 +169,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_compact_construct(H5F_t *f, H5D_t *dset) +H5D__compact_construct(H5F_t *f, H5D_t *dset) { hssize_t stmp_size; /* Temporary holder for raw data size */ hsize_t tmp_size; /* Temporary holder for raw data size */ @@ -180,7 +180,7 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -207,17 +207,17 @@ H5D_compact_construct(H5F_t *f, H5D_t *dset) /* Verify data size is smaller than maximum header message size * (64KB) minus other layout message fields. */ - max_comp_data_size = H5O_MESG_MAX_SIZE - H5D_layout_meta_size(f, &(dset->shared->layout), FALSE); + max_comp_data_size = H5O_MESG_MAX_SIZE - H5D__layout_meta_size(f, &(dset->shared->layout), FALSE); if(dset->shared->layout.storage.u.compact.size > max_comp_data_size) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "compact dataset size is bigger than header message maximum size") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_construct() */ +} /* end H5D__compact_construct() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_is_space_alloc + * Function: H5D__compact_is_space_alloc * * Purpose: Query if space is allocated for layout * @@ -229,20 +229,20 @@ done: *------------------------------------------------------------------------- */ static hbool_t -H5D_compact_is_space_alloc(const H5O_storage_t UNUSED *storage) +H5D__compact_is_space_alloc(const H5O_storage_t UNUSED *storage) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity checks */ HDassert(storage); /* Compact storage is currently always allocated */ FUNC_LEAVE_NOAPI(TRUE) -} /* end H5D_compact_is_space_alloc() */ +} /* end H5D__compact_is_space_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_io_init + * Function: H5D__compact_io_init * * Purpose: Performs initialization before any sort of I/O on the raw data * @@ -254,21 +254,21 @@ H5D_compact_is_space_alloc(const H5O_storage_t UNUSED *storage) *------------------------------------------------------------------------- */ static herr_t -H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, +H5D__compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR io_info->store->compact.buf = io_info->dset->shared->layout.storage.u.compact.buf; io_info->store->compact.dirty = &io_info->dset->shared->layout.storage.u.compact.dirty; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_compact_io_init() */ +} /* end H5D__compact_io_init() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_readvv + * Function: H5D__compact_readvv * * Purpose: Reads some data vectors from a dataset into a buffer. * The data is in compact dataset. The address is relative @@ -286,13 +286,13 @@ H5D_compact_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED * *------------------------------------------------------------------------- */ static ssize_t -H5D_compact_readvv(const H5D_io_info_t *io_info, +H5D__compact_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(io_info); @@ -302,11 +302,11 @@ H5D_compact_readvv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_readvv() */ +} /* end H5D__compact_readvv() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_writevv + * Function: H5D__compact_writevv * * Purpose: Writes some data vectors from a dataset into a buffer. * The data is in compact dataset. The address is relative @@ -327,13 +327,13 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_compact_writevv(const H5D_io_info_t *io_info, +H5D__compact_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[]) { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(io_info); @@ -346,11 +346,11 @@ H5D_compact_writevv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_writevv() */ +} /* end H5D__compact_writevv() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_flush + * Function: H5D__compact_flush * * Purpose: Writes dirty compact data to object header * @@ -362,11 +362,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_compact_flush(H5D_t *dset, hid_t dxpl_id) +H5D__compact_flush(H5D_t *dset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(dset); @@ -380,11 +380,11 @@ H5D_compact_flush(H5D_t *dset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_flush() */ +} /* end H5D__compact_flush() */ /*------------------------------------------------------------------------- - * Function: H5D_compact_copy + * Function: H5D__compact_copy * * Purpose: Copy compact storage raw data from SRC file to DST file. * @@ -396,7 +396,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, +H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) { @@ -409,7 +409,7 @@ H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, hid_t buf_sid = -1; /* ID for buffer dataspace */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f_src); @@ -574,5 +574,5 @@ done: bkg = H5FL_BLK_FREE(type_conv, bkg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compact_copy() */ +} /* end H5D__compact_copy() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index c1ff68c..acc7124 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -95,20 +95,20 @@ typedef struct H5D_contig_writevv_ud_t { /********************/ /* Layout operation callbacks */ -static herr_t H5D_contig_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +static herr_t H5D__contig_construct(H5F_t *f, H5D_t *dset); +static herr_t H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); -static ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info, +static ssize_t H5D__contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, +static ssize_t H5D__contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static herr_t H5D_contig_flush(H5D_t *dset, hid_t dxpl_id); +static herr_t H5D__contig_flush(H5D_t *dset, hid_t dxpl_id); /* Helper routines */ -static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, +static herr_t H5D__contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size); @@ -118,19 +118,19 @@ static herr_t H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, /* Contiguous storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_CONTIG[1] = {{ - H5D_contig_construct, + H5D__contig_construct, NULL, - H5D_contig_is_space_alloc, - H5D_contig_io_init, - H5D_contig_read, - H5D_contig_write, + H5D__contig_is_space_alloc, + H5D__contig_io_init, + H5D__contig_read, + H5D__contig_write, #ifdef H5_HAVE_PARALLEL - H5D_contig_collective_read, - H5D_contig_collective_write, + H5D__contig_collective_read, + H5D__contig_collective_write, #endif /* H5_HAVE_PARALLEL */ - H5D_contig_readvv, - H5D_contig_writevv, - H5D_contig_flush, + H5D__contig_readvv, + H5D__contig_writevv, + H5D__contig_flush, NULL }}; @@ -148,7 +148,7 @@ H5FL_BLK_EXTERN(type_conv); /*------------------------------------------------------------------------- - * Function: H5D_contig_alloc + * Function: H5D__contig_alloc * * Purpose: Allocate file space for a contiguously stored dataset * @@ -160,11 +160,11 @@ H5FL_BLK_EXTERN(type_conv); *------------------------------------------------------------------------- */ herr_t -H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ ) +H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ ) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -176,11 +176,11 @@ H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage /*out */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_alloc */ +} /* end H5D__contig_alloc */ /*------------------------------------------------------------------------- - * Function: H5D_contig_fill + * Function: H5D__contig_fill * * Purpose: Write fill values to a contiguously stored dataset. * @@ -192,7 +192,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) +H5D__contig_fill(H5D_t *dset, hid_t dxpl_id) { H5D_io_info_t ioinfo; /* Dataset I/O info */ H5D_storage_t store; /* Union of storage info for dataset */ @@ -213,7 +213,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) hid_t my_dxpl_id; /* DXPL ID to use for this operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(TRUE == H5P_isa_class(dxpl_id, H5P_DATASET_XFER)); @@ -249,7 +249,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(my_dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(my_dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Initialize storage info for this dataset */ @@ -262,7 +262,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) H5_ASSIGN_OVERFLOW(npoints, snpoints, hssize_t, size_t); /* Initialize the fill value buffer */ - if(H5D_fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, + if(H5D__fill_init(&fb_info, NULL, NULL, NULL, NULL, NULL, &dset->shared->dcpl_cache.fill, dset->shared->type, dset->shared->type_id, npoints, dxpl_cache->max_temp_buf, my_dxpl_id) < 0) @@ -293,7 +293,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Check for VL datatype & non-default fill value */ if(fb_info.has_vlen_fill_type) /* Re-fill the buffer to use for this I/O operation */ - if(H5D_fill_refill_vl(&fb_info, curr_points, my_dxpl_id) < 0) + if(H5D__fill_refill_vl(&fb_info, curr_points, my_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "can't refill fill value buffer") #ifdef H5_HAVE_PARALLEL @@ -302,7 +302,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Write the chunks out from only one process */ /* !! Use the internal "independent" DXPL!! -QAK */ if(H5_PAR_META_WRITE == mpi_rank) - if(H5D_contig_write_one(&ioinfo, offset, size) < 0) + if(H5D__contig_write_one(&ioinfo, offset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset") /* Indicate that blocks are being written */ @@ -311,7 +311,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) else { #endif /* H5_HAVE_PARALLEL */ H5_CHECK_OVERFLOW(size, size_t, hsize_t); - if(H5D_contig_write_one(&ioinfo, offset, size) < 0) + if(H5D__contig_write_one(&ioinfo, offset, size) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset") #ifdef H5_HAVE_PARALLEL } /* end else */ @@ -336,15 +336,15 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) done: /* Release the fill buffer info, if it's been initialized */ - if(fb_info_init && H5D_fill_term(&fb_info) < 0) + if(fb_info_init && H5D__fill_term(&fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_fill() */ +} /* end H5D__contig_fill() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_delete + * Function: H5D__contig_delete * * Purpose: Delete the file space for a contiguously stored dataset * @@ -356,11 +356,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) +H5D__contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -372,36 +372,11 @@ H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const H5O_storage_t *storage) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_delete */ +} /* end H5D__contig_delete */ /*------------------------------------------------------------------------- - * Function: H5D_contig_get_addr - * - * Purpose: Get the offset of the contiguous data on disk - * - * Return: Non-negative on success/Negative on failure - * - * Programmer: Quincey Koziol - * June 2, 2004 - * - *------------------------------------------------------------------------- - */ -haddr_t -H5D_contig_get_addr(const H5D_t *dset) -{ - FUNC_ENTER_NOAPI_NOERR - - /* check args */ - HDassert(dset); - HDassert(dset->shared->layout.type == H5D_CONTIGUOUS); - - FUNC_LEAVE_NOAPI(dset->shared->layout.storage.u.contig.addr) -} /* end H5D_contig_get_addr() */ - - -/*------------------------------------------------------------------------- - * Function: H5D_contig_construct + * Function: H5D__contig_construct * * Purpose: Constructs new contiguous layout information for dataset * @@ -414,7 +389,7 @@ H5D_contig_get_addr(const H5D_t *dset) */ /* ARGSUSED */ static herr_t -H5D_contig_construct(H5F_t *f, H5D_t *dset) +H5D__contig_construct(H5F_t *f, H5D_t *dset) { hssize_t snelmts; /* Temporary holder for number of elements in dataspace */ hsize_t nelmts; /* Number of elements in dataspace */ @@ -427,7 +402,7 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -477,11 +452,11 @@ H5D_contig_construct(H5F_t *f, H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_construct() */ +} /* end H5D__contig_construct() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_is_space_alloc + * Function: H5D__contig_is_space_alloc * * Purpose: Query if space is allocated for layout * @@ -493,11 +468,11 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D_contig_is_space_alloc(const H5O_storage_t *storage) +H5D__contig_is_space_alloc(const H5O_storage_t *storage) { hbool_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ HDassert(storage); @@ -506,11 +481,11 @@ H5D_contig_is_space_alloc(const H5O_storage_t *storage) ret_value = (hbool_t)H5F_addr_defined(storage->u.contig.addr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_is_space_alloc() */ +} /* end H5D__contig_is_space_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_io_init + * Function: H5D__contig_io_init * * Purpose: Performs initialization before any sort of I/O on the raw data * @@ -522,21 +497,21 @@ H5D_contig_is_space_alloc(const H5O_storage_t *storage) *------------------------------------------------------------------------- */ static herr_t -H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, +H5D__contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR io_info->store->contig.dset_addr = io_info->dset->shared->layout.storage.u.contig.addr; io_info->store->contig.dset_size = io_info->dset->shared->layout.storage.u.contig.size; FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_contig_io_init() */ +} /* end H5D__contig_io_init() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_read + * Function: H5D__contig_read * * Purpose: Read from a contiguous dataset. * @@ -548,13 +523,13 @@ H5D_contig_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *t *------------------------------------------------------------------------- */ herr_t -H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(io_info); @@ -569,11 +544,11 @@ H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_read() */ +} /* end H5D__contig_read() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_write + * Function: H5D__contig_write * * Purpose: Write to a contiguous dataset. * @@ -585,13 +560,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(io_info); @@ -606,11 +581,11 @@ H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_write() */ +} /* end H5D__contig_write() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_write_one + * Function: H5D__contig_write_one * * Purpose: Writes some data from a dataset into a buffer. * The data is contiguous. The address is relative to the base @@ -624,7 +599,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size) +H5D__contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size) { hsize_t dset_off = offset; /* Offset in dataset */ size_t dset_len = size; /* Length in dataset */ @@ -634,23 +609,23 @@ H5D_contig_write_one(H5D_io_info_t *io_info, hsize_t offset, size_t size) size_t mem_curr_seq = 0; /* "Current sequence" in memory */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(io_info); - if(H5D_contig_writevv(io_info, (size_t)1, &dset_curr_seq, &dset_len, &dset_off, + if(H5D__contig_writevv(io_info, (size_t)1, &dset_curr_seq, &dset_len, &dset_off, (size_t)1, &mem_curr_seq, &mem_len, &mem_off) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_write_one() */ +} /* end H5D__contig_write_one() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_readvv_sieve_cb + * Function: H5D__contig_readvv_sieve_cb * - * Purpose: Callback operator for H5D_contig_readvv() with sieve buffer. + * Purpose: Callback operator for H5D__contig_readvv() with sieve buffer. * * Return: Non-negative on success/Negative on failure * @@ -660,7 +635,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, +H5D__contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_contig_readvv_sieve_ud_t *udata = (H5D_contig_readvv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ @@ -676,7 +651,7 @@ H5D_contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, hsize_t max_data; /* Actual maximum size of data to cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Stash local copies of these value */ if(dset_contig->sieve_buf != NULL) { @@ -811,13 +786,13 @@ H5D_contig_readvv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_readvv_sieve_cb() */ +} /* end H5D__contig_readvv_sieve_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_readvv_cb + * Function: H5D__contig_readvv_cb * - * Purpose: Callback operator for H5D_contig_readvv() without sieve buffer. + * Purpose: Callback operator for H5D__contig_readvv() without sieve buffer. * * Return: Non-negative on success/Negative on failure * @@ -827,12 +802,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +H5D__contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_contig_readvv_ud_t *udata = (H5D_contig_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Write data */ if(H5F_block_read(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), @@ -841,11 +816,11 @@ H5D_contig_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_readvv_cb() */ +} /* end H5D__contig_readvv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_readvv + * Function: H5D__contig_readvv * * Purpose: Reads some data vectors from a dataset into a buffer. * The data is contiguous. The address is the start of the dataset, @@ -863,13 +838,13 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_contig_readvv(const H5D_io_info_t *io_info, +H5D__contig_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { ssize_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -894,7 +869,7 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_contig_readvv_sieve_cb, &udata)) < 0) + H5D__contig_readvv_sieve_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer read") } /* end if */ else { @@ -909,19 +884,19 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_contig_readvv_cb, &udata)) < 0) + H5D__contig_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_readvv() */ +} /* end H5D__contig_readvv() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_writevv_sieve_cb + * Function: H5D__contig_writevv_sieve_cb * - * Purpose: Callback operator for H5D_contig_writevv() with sieve buffer. + * Purpose: Callback operator for H5D__contig_writevv() with sieve buffer. * * Return: Non-negative on success/Negative on failure * @@ -931,7 +906,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, +H5D__contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_contig_writevv_sieve_ud_t *udata = (H5D_contig_writevv_sieve_ud_t *)_udata; /* User data for H5V_opvv() operator */ @@ -947,7 +922,7 @@ H5D_contig_writevv_sieve_cb(hsize_t dst_off, hsize_t src_off, size_t len, hsize_t max_data; /* Actual maximum size of data to cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Stash local copies of these values */ if(dset_contig->sieve_buf != NULL) { @@ -1133,13 +1108,13 @@ if(dset_contig->sieve_size > len) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_writevv_sieve_cb() */ +} /* end H5D__contig_writevv_sieve_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_writevv_cb + * Function: H5D__contig_writevv_cb * - * Purpose: Callback operator for H5D_contig_writevv(). + * Purpose: Callback operator for H5D__contig_writevv(). * * Return: Non-negative on success/Negative on failure * @@ -1149,12 +1124,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +H5D__contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_contig_writevv_ud_t *udata = (H5D_contig_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Write data */ if(H5F_block_write(udata->file, H5FD_MEM_DRAW, (udata->dset_addr + dst_off), len, udata->dxpl_id, (udata->wbuf + src_off)) < 0) @@ -1162,11 +1137,11 @@ H5D_contig_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_writevv_cb() */ +} /* end H5D__contig_writevv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_writevv + * Function: H5D__contig_writevv * * Purpose: Writes some data vectors into a dataset from vectors into a * buffer. The address is the start of the dataset, @@ -1184,13 +1159,13 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_contig_writevv(const H5D_io_info_t *io_info, +H5D__contig_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { ssize_t ret_value; /* Return value (Size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -1215,7 +1190,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_contig_writevv_sieve_cb, &udata)) < 0) + H5D__contig_writevv_sieve_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized sieve buffer write") } /* end if */ else { @@ -1230,17 +1205,17 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_contig_writevv_cb, &udata)) < 0) + H5D__contig_writevv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized read") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_writevv() */ +} /* end H5D__contig_writevv() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_flush + * Function: H5D__contig_flush * * Purpose: Writes all dirty data to disk. * @@ -1252,26 +1227,26 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_contig_flush(H5D_t *dset, hid_t dxpl_id) +H5D__contig_flush(H5D_t *dset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(dset); /* Flush any data in sieve buffer */ - if(H5D_flush_sieve_buf(dset, dxpl_id) < 0) + if(H5D__flush_sieve_buf(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTFLUSH, FAIL, "unable to flush sieve buffer") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_flush() */ +} /* end H5D__contig_flush() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_copy + * Function: H5D__contig_copy * * Purpose: Copy contiguous storage raw data from SRC file to DST file. * @@ -1283,7 +1258,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, +H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *dt_src, H5O_copy_t *cpy_info, hid_t dxpl_id) { @@ -1315,7 +1290,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, hbool_t fix_ref = FALSE; /* Flag to indicate that ref values should be fixed */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f_src); @@ -1325,7 +1300,7 @@ H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, HDassert(dt_src); /* Allocate space for destination raw data */ - if(H5D_contig_alloc(f_dst, dxpl_id, storage_dst) < 0) + if(H5D__contig_alloc(f_dst, dxpl_id, storage_dst) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to allocate contiguous storage") /* Set up number of bytes to copy, and initial buffer size */ @@ -1532,5 +1507,5 @@ done: bkg = H5FL_BLK_FREE(type_conv, bkg); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_copy() */ +} /* end H5D__contig_copy() */ diff --git a/src/H5Ddbg.c b/src/H5Ddbg.c index 9b27c9c..a7c6dc1 100644 --- a/src/H5Ddbg.c +++ b/src/H5Ddbg.c @@ -20,7 +20,7 @@ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D_init_dbg_interface +#define H5_INTERFACE_INIT_FUNC H5D__init_dbg_interface /***********/ @@ -64,9 +64,9 @@ /*-------------------------------------------------------------------------- NAME - H5D_init_dbg_interface -- Initialize interface-specific information + H5D__init_dbg_interface -- Initialize interface-specific information USAGE - herr_t H5D_init_dbg_interface() + herr_t H5D__init_dbg_interface() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -75,12 +75,12 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5D_init_dbg_interface(void) +H5D__init_dbg_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D_init_dbg_interface() */ +} /* H5D__init_dbg_interface() */ /*------------------------------------------------------------------------- @@ -113,7 +113,7 @@ H5Ddebug(hid_t dset_id) /* Print B-tree information */ if(H5D_CHUNKED == dset->shared->layout.type) - (void)H5D_chunk_dump_index(dset, H5AC_dxpl_id, stdout); + (void)H5D__chunk_dump_index(dset, H5AC_dxpl_id, stdout); else if(H5D_CONTIGUOUS == dset->shared->layout.type) HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.storage.u.contig.addr); diff --git a/src/H5Ddeprec.c b/src/H5Ddeprec.c index 7e65149..1999550 100644 --- a/src/H5Ddeprec.c +++ b/src/H5Ddeprec.c @@ -34,7 +34,7 @@ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D_init_deprec_interface +#define H5_INTERFACE_INIT_FUNC H5D__init_deprec_interface /***********/ @@ -66,7 +66,7 @@ /********************/ #ifndef H5_NO_DEPRECATED_SYMBOLS -static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); +static herr_t H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); #endif /* H5_NO_DEPRECATED_SYMBOLS */ @@ -88,9 +88,9 @@ static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); /*-------------------------------------------------------------------------- NAME - H5D_init_deprec_interface -- Initialize interface-specific information + H5D__init_deprec_interface -- Initialize interface-specific information USAGE - herr_t H5D_init_deprec_interface() + herr_t H5D__init_deprec_interface() RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -99,12 +99,12 @@ DESCRIPTION --------------------------------------------------------------------------*/ static herr_t -H5D_init_deprec_interface(void) +H5D__init_deprec_interface(void) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR FUNC_LEAVE_NOAPI(H5D_init()) -} /* H5D_init_deprec_interface() */ +} /* H5D__init_deprec_interface() */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -293,7 +293,7 @@ H5Dextend(hid_t dset_id, const hsize_t size[]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified") /* Increase size */ - if(H5D_extend(dset, size, H5AC_dxpl_id) < 0) + if(H5D__extend(dset, size, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset") done: @@ -302,7 +302,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_extend + * Function: H5D__extend * * Purpose: Increases the size of a dataset. * @@ -314,7 +314,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) +H5D__extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) { htri_t changed; /* Flag to indicate that the dataspace was successfully extended */ H5S_t *space; /* Dataset's dataspace */ @@ -323,14 +323,14 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); HDassert(size); /* Check if the filters in the DCPL will need to encode, and if so, can they? */ - if(H5D_check_filters(dataset) < 0) + if(H5D__check_filters(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") /* @@ -352,26 +352,26 @@ H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) if(changed) { /* Update the index values for the cached chunks for this dataset */ if(H5D_CHUNKED == dataset->shared->layout.type) { - if(H5D_chunk_set_info(dataset) < 0) + if(H5D__chunk_set_info(dataset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - if(H5D_chunk_update_cache(dataset, dxpl_id) < 0) + if(H5D__chunk_update_cache(dataset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ fill = &dataset->shared->dcpl_cache.fill; if(fill->alloc_time == H5D_ALLOC_TIME_EARLY) - if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, + if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D_mark(dataset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dataset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_extend() */ +} /* end H5D__extend() */ #endif /* H5_NO_DEPRECATED_SYMBOLS */ diff --git a/src/H5Defl.c b/src/H5Defl.c index 51e8813..c5cf8e2 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -63,21 +63,21 @@ typedef struct H5D_efl_writevv_ud_t { /********************/ /* Layout operation callbacks */ -static herr_t H5D_efl_construct(H5F_t *f, H5D_t *dset); -static herr_t H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +static herr_t H5D__efl_construct(H5F_t *f, H5D_t *dset); +static herr_t H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *cm); -static ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info, +static ssize_t H5D__efl_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); -static ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info, +static ssize_t H5D__efl_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[]); /* Helper routines */ -static herr_t H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, +static herr_t H5D__efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf); -static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, +static herr_t H5D__efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf); @@ -87,18 +87,18 @@ static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, /* External File List (EFL) storage layout I/O ops */ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ - H5D_efl_construct, + H5D__efl_construct, NULL, - H5D_efl_is_space_alloc, - H5D_efl_io_init, - H5D_contig_read, - H5D_contig_write, + H5D__efl_is_space_alloc, + H5D__efl_io_init, + H5D__contig_read, + H5D__contig_write, #ifdef H5_HAVE_PARALLEL NULL, NULL, #endif /* H5_HAVE_PARALLEL */ - H5D_efl_readvv, - H5D_efl_writevv, + H5D__efl_readvv, + H5D__efl_writevv, NULL, NULL }}; @@ -111,7 +111,7 @@ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ /*------------------------------------------------------------------------- - * Function: H5D_efl_construct + * Function: H5D__efl_construct * * Purpose: Constructs new EFL layout information for dataset * @@ -123,7 +123,7 @@ const H5D_layout_ops_t H5D_LOPS_EFL[1] = {{ *------------------------------------------------------------------------- */ static herr_t -H5D_efl_construct(H5F_t *f, H5D_t *dset) +H5D__efl_construct(H5F_t *f, H5D_t *dset) { size_t dt_size; /* Size of datatype */ hsize_t dim[H5O_LAYOUT_NDIMS]; /* Current size of data in elements */ @@ -136,7 +136,7 @@ H5D_efl_construct(H5F_t *f, H5D_t *dset) int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -182,11 +182,11 @@ H5D_efl_construct(H5F_t *f, H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_construct() */ +} /* end H5D__efl_construct() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_is_space_alloc + * Function: H5D__efl_is_space_alloc * * Purpose: Query if space is allocated for layout * @@ -198,20 +198,20 @@ done: *------------------------------------------------------------------------- */ hbool_t -H5D_efl_is_space_alloc(const H5O_storage_t UNUSED *storage) +H5D__efl_is_space_alloc(const H5O_storage_t UNUSED *storage) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Sanity checks */ HDassert(storage); /* EFL storage is currently always treated as allocated */ FUNC_LEAVE_NOAPI(TRUE) -} /* end H5D_efl_is_space_alloc() */ +} /* end H5D__efl_is_space_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_io_init + * Function: H5D__efl_io_init * * Purpose: Performs initialization before any sort of I/O on the raw data * @@ -223,20 +223,20 @@ H5D_efl_is_space_alloc(const H5O_storage_t UNUSED *storage) *------------------------------------------------------------------------- */ static herr_t -H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, +H5D__efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t UNUSED *cm) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR HDmemcpy(&io_info->store->efl, &(io_info->dset->shared->dcpl_cache.efl), sizeof(H5O_efl_t)); FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_efl_io_init() */ +} /* end H5D__efl_io_init() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_read + * Function: H5D__efl_read * * Purpose: Reads data from an external file list. It is an error to * read past the logical end of file, but reading past the end @@ -254,7 +254,7 @@ H5D_efl_io_init(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type *------------------------------------------------------------------------- */ static herr_t -H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) +H5D__efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) { int fd = -1; size_t to_read; @@ -267,40 +267,40 @@ H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ - HDassert(efl && efl->nused>0); + HDassert(efl && efl->nused > 0); HDassert(H5F_addr_defined(addr)); HDassert(size < SIZET_MAX); HDassert(buf || 0 == size); /* Find the first efl member from which to read */ for (u=0, cur=0; unused; u++) { - if (H5O_EFL_UNLIMITED==efl->slot[u].size || addr < cur+efl->slot[u].size) { + if(H5O_EFL_UNLIMITED == efl->slot[u].size || addr < cur + efl->slot[u].size) { skip = addr - cur; break; - } + } /* end if */ cur += efl->slot[u].size; - } + } /* end for */ /* Read the data */ while(size) { HDassert(buf); - if(u>=efl->nused) + if(u >= efl->nused) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file") - if(H5F_OVERFLOW_HSIZET2OFFT (efl->slot[u].offset + skip)) + if(H5F_OVERFLOW_HSIZET2OFFT(efl->slot[u].offset + skip)) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") if((fd = HDopen(efl->slot[u].name, O_RDONLY, 0)) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file") if(HDlseek(fd, (off_t)(efl->slot[u].offset + skip), SEEK_SET) < 0) HGOTO_ERROR(H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file") #ifndef NDEBUG - tempto_read = MIN(efl->slot[u].size-skip,(hsize_t)size); - H5_CHECK_OVERFLOW(tempto_read,hsize_t,size_t); + tempto_read = MIN(efl->slot[u].size-skip, (hsize_t)size); + H5_CHECK_OVERFLOW(tempto_read, hsize_t, size_t); to_read = (size_t)tempto_read; #else /* NDEBUG */ - to_read = MIN((size_t)(efl->slot[u].size-skip), size); + to_read = MIN((size_t)(efl->slot[u].size - skip), size); #endif /* NDEBUG */ if((n = HDread(fd, buf, to_read)) < 0) HGOTO_ERROR(H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file") @@ -312,18 +312,18 @@ H5D_efl_read(const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) buf += to_read; skip = 0; u++; - } + } /* end while */ done: - if (fd>=0) - HDclose (fd); + if(fd >= 0) + HDclose(fd); FUNC_LEAVE_NOAPI(ret_value) -} +} /* end H5D__efl_read() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_write + * Function: H5D__efl_write * * Purpose: Writes data to an external file list. It is an error to * write past the logical end of file, but writing past the end @@ -341,7 +341,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf) +H5D__efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *buf) { int fd = -1; size_t to_write; @@ -353,7 +353,7 @@ H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *bu size_t u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(efl && efl->nused > 0); @@ -377,7 +377,7 @@ H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *bu HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "write past logical end of file") if(H5F_OVERFLOW_HSIZET2OFFT(efl->slot[u].offset + skip)) HGOTO_ERROR(H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed") - if((fd = HDopen(efl->slot[u].name, O_CREAT|O_RDWR, 0666)) < 0) { + if((fd = HDopen(efl->slot[u].name, O_CREAT | O_RDWR, 0666)) < 0) { if(HDaccess(efl->slot[u].name, F_OK) < 0) HGOTO_ERROR(H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist") else @@ -392,7 +392,7 @@ H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *bu #else /* NDEBUG */ to_write = MIN((size_t)(efl->slot[u].size - skip), size); #endif /* NDEBUG */ - if((size_t)HDwrite(fd, buf, to_write)!=to_write) + if((size_t)HDwrite(fd, buf, to_write) != to_write) HGOTO_ERROR(H5E_EFL, H5E_READERROR, FAIL, "write error in external raw data file") HDclose (fd); fd = -1; @@ -407,13 +407,13 @@ done: HDclose(fd); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_write() */ +} /* end H5D__efl_write() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_readvv_cb + * Function: H5D__efl_readvv_cb * - * Purpose: Callback operator for H5D_efl_readvv(). + * Purpose: Callback operator for H5D__efl_readvv(). * * Return: Non-negative on success/Negative on failure * @@ -423,24 +423,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +H5D__efl_readvv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_efl_readvv_ud_t *udata = (H5D_efl_readvv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Read data */ - if(H5D_efl_read(udata->efl, dst_off, len, (udata->rbuf + src_off)) < 0) + if(H5D__efl_read(udata->efl, dst_off, len, (udata->rbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "EFL read failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_readvv_cb() */ +} /* end H5D__efl_readvv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_readvv + * Function: H5D__efl_readvv * * Purpose: Reads data from an external file list. It is an error to * read past the logical end of file, but reading past the end @@ -455,14 +455,14 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_efl_readvv(const H5D_io_info_t *io_info, +H5D__efl_readvv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_readvv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -482,18 +482,18 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_efl_readvv_cb, &udata)) < 0) + H5D__efl_readvv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL read") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_readvv() */ +} /* end H5D__efl_readvv() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_writevv_cb + * Function: H5D__efl_writevv_cb * - * Purpose: Callback operator for H5D_efl_writevv(). + * Purpose: Callback operator for H5D__efl_writevv(). * * Return: Non-negative on success/Negative on failure * @@ -503,24 +503,24 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) +H5D__efl_writevv_cb(hsize_t dst_off, hsize_t src_off, size_t len, void *_udata) { H5D_efl_writevv_ud_t *udata = (H5D_efl_writevv_ud_t *)_udata; /* User data for H5V_opvv() operator */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Write data */ - if(H5D_efl_write(udata->efl, dst_off, len, (udata->wbuf + src_off)) < 0) + if(H5D__efl_write(udata->efl, dst_off, len, (udata->wbuf + src_off)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "EFL write failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_writevv_cb() */ +} /* end H5D__efl_writevv_cb() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_writevv + * Function: H5D__efl_writevv * * Purpose: Writes data to an external file list. It is an error to * write past the logical end of file, but writing past the end @@ -535,14 +535,14 @@ done: *------------------------------------------------------------------------- */ static ssize_t -H5D_efl_writevv(const H5D_io_info_t *io_info, +H5D__efl_writevv(const H5D_io_info_t *io_info, size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_off_arr[], size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_off_arr[]) { H5D_efl_writevv_ud_t udata; /* User data for H5V_opvv() operator */ ssize_t ret_value; /* Return value (Total size of sequence in bytes) */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -562,15 +562,15 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, /* Call generic sequence operation routine */ if((ret_value = H5V_opvv(dset_max_nseq, dset_curr_seq, dset_len_arr, dset_off_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_off_arr, - H5D_efl_writevv_cb, &udata)) < 0) + H5D__efl_writevv_cb, &udata)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPERATE, FAIL, "can't perform vectorized EFL write") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_efl_writevv() */ +} /* end H5D__efl_writevv() */ /*------------------------------------------------------------------------- - * Function: H5D_efl_bh_size + * Function: H5D__efl_bh_info * * Purpose: Retrieve the amount of heap storage used for External File * List message @@ -583,11 +583,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) +H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(f); @@ -601,4 +601,4 @@ H5D_efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_bh_info() */ +} /* end H5D__efl_bh_info() */ diff --git a/src/H5Dfill.c b/src/H5Dfill.c index c0a9766..0d9c9e7 100644 --- a/src/H5Dfill.c +++ b/src/H5Dfill.c @@ -61,6 +61,8 @@ /* Local Prototypes */ /********************/ +static herr_t H5D__fill_release(H5D_fill_buf_info_t *fb_info); + /*********************/ /* Package Variables */ @@ -131,7 +133,7 @@ H5Dfill(const void *fill, hid_t fill_type_id, void *buf, hid_t buf_type_id, hid_ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype") /* Fill the selection in the memory buffer */ - if(H5D_fill(fill, fill_type, buf, buf_type, space, H5AC_dxpl_id) < 0) + if(H5D__fill(fill, fill_type, buf, buf_type, space, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed") done: @@ -141,11 +143,11 @@ done: /*-------------------------------------------------------------------------- NAME - H5D_fill + H5D__fill PURPOSE Fill a selection in memory with a value (internal version) USAGE - herr_t H5D_fill(fill, fill_type, buf, buf_type, space) + herr_t H5D__fill(fill, fill_type, buf, buf_type, space) const void *fill; IN: Pointer to fill value to use H5T_t *fill_type; IN: Datatype of the fill value void *buf; IN/OUT: Memory buffer to fill selection within @@ -168,7 +170,7 @@ done: on each element so that each of them has a copy of the VL data. --------------------------------------------------------------------------*/ herr_t -H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, +H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id) { H5WB_t *elem_wb = NULL; /* Wrapped buffer for element data */ @@ -181,7 +183,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, size_t dst_type_size; /* Size of destination type*/ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(fill_type); @@ -267,7 +269,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, HGOTO_ERROR(H5E_DATASET, H5E_CANTCONVERT, FAIL, "data type conversion failed") /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Create a selection iterator for scattering the elements to memory buffer */ @@ -275,7 +277,7 @@ H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize memory selection information") /* Scatter the data into memory */ - if(H5D_scatter_mem(tmp_buf, space, &mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) { + if(H5D__scatter_mem(tmp_buf, space, &mem_iter, (size_t)nelmts, dxpl_cache, buf/*out*/) < 0) { H5S_SELECT_ITER_RELEASE(&mem_iter); HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end if */ @@ -346,11 +348,11 @@ done: bkg_buf = H5FL_BLK_FREE(type_conv, bkg_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_fill() */ +} /* H5D__fill() */ /*------------------------------------------------------------------------- - * Function: H5D_fill_init + * Function: H5D__fill_init * * Purpose: Initialize buffer filling operation * @@ -362,7 +364,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, +H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, @@ -370,7 +372,7 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(fb_info); @@ -541,15 +543,15 @@ H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, done: /* Cleanup on error */ if(ret_value < 0) - if(H5D_fill_term(fb_info) < 0) + if(H5D__fill_term(fb_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release fill buffer info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_fill_init() */ +} /* end H5D__fill_init() */ /*------------------------------------------------------------------------- - * Function: H5D_fill_refill_vl + * Function: H5D__fill_refill_vl * * Purpose: Refill fill value buffer that contains VL-datatype fill values * @@ -561,12 +563,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) +H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ void * buf = NULL; /* Temporary fill buffer */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(fb_info); @@ -626,11 +628,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_fill_refill_vl() */ +} /* end H5D__fill_refill_vl() */ /*------------------------------------------------------------------------- - * Function: H5D_fill_release + * Function: H5D__fill_release * * Purpose: Release fill value buffer * @@ -641,10 +643,10 @@ done: * *------------------------------------------------------------------------- */ -herr_t -H5D_fill_release(H5D_fill_buf_info_t *fb_info) +static herr_t +H5D__fill_release(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE /* Check args */ HDassert(fb_info); @@ -664,11 +666,11 @@ H5D_fill_release(H5D_fill_buf_info_t *fb_info) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_fill_release() */ +} /* end H5D__fill_release() */ /*------------------------------------------------------------------------- - * Function: H5D_fill_term + * Function: H5D__fill_term * * Purpose: Release fill value buffer info * @@ -680,15 +682,15 @@ H5D_fill_release(H5D_fill_buf_info_t *fb_info) *------------------------------------------------------------------------- */ herr_t -H5D_fill_term(H5D_fill_buf_info_t *fb_info) +H5D__fill_term(H5D_fill_buf_info_t *fb_info) { - FUNC_ENTER_NOAPI_NOERR + FUNC_ENTER_PACKAGE /* Check args */ HDassert(fb_info); /* Free the buffer for fill values */ - H5D_fill_release(fb_info); + H5D__fill_release(fb_info); /* Free other resources for vlen fill values */ if(fb_info->has_vlen_fill_type) { @@ -701,5 +703,5 @@ H5D_fill_term(H5D_fill_buf_info_t *fb_info) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_fill_term() */ +} /* end H5D__fill_term() */ diff --git a/src/H5Dint.c b/src/H5Dint.c index 28d5367..62d0f09 100644 --- a/src/H5Dint.c +++ b/src/H5Dint.c @@ -20,7 +20,7 @@ #define H5D_PACKAGE /*suppress error about including H5Dpkg */ /* Interface initialization */ -#define H5_INTERFACE_INIT_FUNC H5D_init_interface +#define H5_INTERFACE_INIT_FUNC H5D__init_interface /***********/ @@ -57,17 +57,17 @@ typedef struct { /********************/ /* General stuff */ -static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, - hsize_t old_dim[], hid_t dxpl_id); -static herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); -static H5D_shared_t *H5D_new(hid_t dcpl_id, hbool_t creating, +static herr_t H5D__get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache); +static H5D_shared_t *H5D__new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static herr_t H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, +static herr_t H5D__init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type); -static herr_t H5D_init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); -static herr_t H5D_update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, +static herr_t H5D__init_space(H5F_t *file, const H5D_t *dset, const H5S_t *space); +static herr_t H5D__update_oh_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, hid_t dapl_id); -static herr_t H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id); +static herr_t H5D__init_storage(H5D_t *dataset, hbool_t full_overwrite, + hsize_t old_dim[], hid_t dxpl_id); /*********************/ @@ -125,7 +125,7 @@ static H5D_shared_t H5D_def_dset; herr_t H5D_init(void) { - herr_t ret_value=SUCCEED; /* Return value */ + herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) /* FUNC_ENTER() does all the work */ @@ -137,9 +137,9 @@ done: /*-------------------------------------------------------------------------- NAME - H5D_init_interface -- Initialize interface-specific information + H5D__init_interface -- Initialize interface-specific information USAGE - herr_t H5D_init_interface() + herr_t H5D__init_interface() RETURNS Non-negative on success/Negative on failure @@ -151,12 +151,12 @@ NOTES --------------------------------------------------------------------------*/ static herr_t -H5D_init_interface(void) +H5D__init_interface(void) { H5P_genplist_t *def_dcpl; /* Default Dataset Creation Property list */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Initialize the atom group for the dataset IDs */ if(H5I_register_type(H5I_DATASET, (size_t)H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)shared->layout.type == H5D_CHUNKED && layout_init) { - if(H5D_chunk_dest(file, dxpl_id, dset) < 0) + if(H5D__chunk_dest(file, dxpl_id, dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_update_oh_info() */ +} /* end H5D__update_oh_info() */ /*------------------------------------------------------------------------- - * Function: H5D_create + * Function: H5D__create * * Purpose: Creates a new dataset with name NAME in file F and associates * with it a datatype TYPE for each element as stored in the @@ -902,7 +903,7 @@ done: *------------------------------------------------------------------------- */ H5D_t * -H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, +H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id) { const H5T_t *type; /* Datatype for dataset */ @@ -913,7 +914,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, H5G_loc_t dset_loc; /* Dataset location */ H5D_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(file); @@ -948,15 +949,15 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, H5G_loc_reset(&dset_loc); /* Initialize the shared dataset space */ - if(NULL == (new_dset->shared = H5D_new(dcpl_id, TRUE, has_vl_type))) + if(NULL == (new_dset->shared = H5D__new(dcpl_id, TRUE, has_vl_type))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Copy & initialize datatype for dataset */ - if(H5D_init_type(file, new_dset, type_id, type) < 0) + if(H5D__init_type(file, new_dset, type_id, type) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy datatype") /* Copy & initialize dataspace for dataset */ - if(H5D_init_space(file, new_dset, space) < 0) + if(H5D__init_space(file, new_dset, space) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't copy dataspace") /* Set the dataset's checked_filters flag to enable writing */ @@ -1026,7 +1027,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, new_dset->shared->dcpl_cache.fill.alloc_time = H5D_ALLOC_TIME_EARLY; /* Set the dataset's I/O operations */ - if(H5D_layout_set_io_ops(new_dset) < 0) + if(H5D__layout_set_io_ops(new_dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to initialize I/O operations") /* Create the layout information for the new dataset */ @@ -1034,7 +1035,7 @@ H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to construct layout information") /* Update the dataset's object header info. */ - if(H5D_update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) + if(H5D__update_oh_info(file, dxpl_id, new_dset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "can't update the metadata cache") /* Indicate that the layout information was initialized */ @@ -1054,7 +1055,7 @@ done: if(!ret_value && new_dset && new_dset->shared) { if(new_dset->shared) { if(new_dset->shared->layout.type == H5D_CHUNKED && layout_init) { - if(H5D_chunk_dest(file, dxpl_id, new_dset) < 0) + if(H5D__chunk_dest(file, dxpl_id, new_dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, NULL, "unable to destroy chunk cache") } /* end if */ if(new_dset->shared->space && H5S_close(new_dset->shared->space) < 0) @@ -1080,7 +1081,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_create() */ +} /* end H5D__create() */ /* @@ -1128,7 +1129,7 @@ H5D_open(const H5G_loc_t *loc, hid_t dapl_id, hid_t dxpl_id) H5E_clear_stack(NULL); /* Open the dataset object */ - if(H5D_open_oid(dataset, dapl_id, dxpl_id) < 0) + if(H5D__open_oid(dataset, dapl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, NULL, "not found") /* Add the dataset to the list of opened objects in the file */ @@ -1184,7 +1185,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_open_oid + * Function: H5D__open_oid * * Purpose: Opens a dataset for access. * @@ -1196,7 +1197,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) +H5D__open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) { H5P_genplist_t *plist; /* Property list */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value info */ @@ -1204,13 +1205,13 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset); /* (Set the 'vl_type' parameter to FALSE since it doesn't matter from here) */ - if(NULL == (dataset->shared = H5D_new(H5P_DATASET_CREATE_DEFAULT, FALSE, FALSE))) + if(NULL == (dataset->shared = H5D__new(H5P_DATASET_CREATE_DEFAULT, FALSE, FALSE))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Open the dataset object */ @@ -1236,7 +1237,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get dataset creation property list") /* Get the layout/pline/efl message information */ - if(H5D_layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) + if(H5D__layout_oh_read(dataset, dxpl_id, dapl_id, plist) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get layout/pline/efl info") /* Point at dataset's copy, to cache it for later */ @@ -1305,7 +1306,7 @@ H5D_open_oid(H5D_t *dataset, hid_t dapl_id, hid_t dxpl_id) if((H5F_INTENT(dataset->oloc.file) & H5F_ACC_RDWR) && !(*dataset->shared->layout.ops->is_space_alloc)(&dataset->shared->layout.storage) && H5F_HAS_FEATURE(dataset->oloc.file, H5FD_FEAT_ALLOCATE_EARLY)) { - if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0) + if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_OPEN, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize file storage") } /* end if */ @@ -1330,7 +1331,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_open_oid() */ +} /* end H5D__open_oid() */ /*------------------------------------------------------------------------- @@ -1361,13 +1362,13 @@ H5D_close(H5D_t *dataset) /* Dump debugging info */ #ifdef H5D_CHUNK_DEBUG - H5D_chunk_stats(dataset, FALSE); + H5D__chunk_stats(dataset, FALSE); #endif /* H5D_CHUNK_DEBUG */ dataset->shared->fo_count--; if(dataset->shared->fo_count == 0) { /* Flush the dataset's information. Continue to close even if it fails. */ - if(H5D_flush_real(dataset, H5AC_dxpl_id) < 0) + if(H5D__flush_real(dataset, H5AC_dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") /* Free the data sieve buffer, if it's been allocated */ @@ -1404,7 +1405,7 @@ H5D_close(H5D_t *dataset) /* Flush and destroy chunks in the cache. Continue to close even if * it fails. */ - if(H5D_chunk_dest(dataset->oloc.file, H5AC_dxpl_id, dataset) < 0) + if(H5D__chunk_dest(dataset->oloc.file, H5AC_dxpl_id, dataset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") break; @@ -1557,7 +1558,7 @@ H5D_typeof(const H5D_t *dset) /*------------------------------------------------------------------------- - * Function: H5D_alloc_storage + * Function: H5D__alloc_storage * * Purpose: Allocate storage for the raw data of a dataset. * @@ -1569,7 +1570,7 @@ H5D_typeof(const H5D_t *dset) *------------------------------------------------------------------------- */ herr_t -H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5D__alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]) { H5F_t *f = dset->oloc.file; /* The dataset's file pointer */ @@ -1578,7 +1579,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al hbool_t addr_set = FALSE; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(dset); @@ -1598,7 +1599,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al /* Check if we have a zero-sized dataset */ if(layout->storage.u.contig.size > 0) { /* Reserve space in the file for the entire array */ - if(H5D_contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) + if(H5D__contig_alloc(f, dxpl_id, &layout->storage.u.contig/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize contiguous storage") /* Indicate that we should initialize storage space */ @@ -1615,7 +1616,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al case H5D_CHUNKED: if(!(*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Create the root of the B-tree that describes chunked storage */ - if(H5D_chunk_create(dset /*in,out*/, dxpl_id) < 0) + if(H5D__chunk_create(dset /*in,out*/, dxpl_id) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "unable to initialize chunked storage") /* Indicate that we set the storage addr */ @@ -1679,7 +1680,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al * this is icky. -QAK */ if(!(dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_INCR && time_alloc == H5D_ALLOC_WRITE)) - if(H5D_init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) + if(H5D__init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") } /* end if */ else { @@ -1693,7 +1694,7 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al * the fill value _is_ set, do that now */ if(dset->shared->dcpl_cache.fill.fill_time == H5D_FILL_TIME_ALLOC || (dset->shared->dcpl_cache.fill.fill_time == H5D_FILL_TIME_IFSET && fill_status == H5D_FILL_VALUE_USER_DEFINED)) { - if(H5D_init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) + if(H5D__init_storage(dset, full_overwrite, old_dim, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize dataset with fill value") } /* end if */ } /* end else */ @@ -1708,17 +1709,17 @@ H5D_alloc_storage(H5D_t *dset/*in,out*/, hid_t dxpl_id, H5D_time_alloc_t time_al */ if(time_alloc != H5D_ALLOC_CREATE && addr_set) /* Mark the layout as dirty, for later writing to the file */ - if(H5D_mark(dset, dxpl_id, H5D_MARK_LAYOUT) < 0) + if(H5D__mark(dset, dxpl_id, H5D_MARK_LAYOUT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_alloc_storage() */ +} /* end H5D__alloc_storage() */ /*------------------------------------------------------------------------- - * Function: H5D_init_storage + * Function: H5D__init_storage * * Purpose: Initialize the data for a new dataset. If a selection is * defined for SPACE then initialize only that part of the @@ -1732,12 +1733,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], +H5D__init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(dset); @@ -1746,7 +1747,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], /* If we will be immediately overwriting the values, don't bother to clear them */ if(!full_overwrite) { /* Fill the compact dataset storage */ - if(H5D_compact_fill(dset, dxpl_id) < 0) + if(H5D__compact_fill(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize compact dataset storage") } /* end if */ break; @@ -1755,7 +1756,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], /* Don't write default fill values to external files */ /* If we will be immediately overwriting the values, don't bother to clear them */ if((dset->shared->dcpl_cache.efl.nused == 0 || dset->shared->dcpl_cache.fill.buf) && !full_overwrite) - if(H5D_contig_fill(dset, dxpl_id) < 0) + if(H5D__contig_fill(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") break; @@ -1771,7 +1772,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], if(old_dim == NULL) old_dim = zero_dim; - if(H5D_chunk_allocate(dset, dxpl_id, full_overwrite, old_dim) < 0) + if(H5D__chunk_allocate(dset, dxpl_id, full_overwrite, old_dim) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") break; } /* end block */ @@ -1787,68 +1788,66 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hsize_t old_dim[], done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_init_storage() */ +} /* end H5D__init_storage() */ /*------------------------------------------------------------------------- - * Function: H5D_get_storage_size + * Function: H5D__get_storage_size * * Purpose: Determines how much space has been reserved to store the raw * data of a dataset. * - * Return: Success: Number of bytes reserved to hold raw data. - * - * Failure: 0 + * Return: Non-negative on success, negative on failure * * Programmer: Robb Matzke * Wednesday, April 21, 1999 * *------------------------------------------------------------------------- */ -hsize_t -H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) +herr_t +H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size) { - hsize_t ret_value; + herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, 0) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) switch(dset->shared->layout.type) { case H5D_CHUNKED: if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { - if(H5D_chunk_allocated(dset, dxpl_id, &ret_value) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, 0, "can't retrieve chunked dataset allocated size") + if(H5D__chunk_allocated(dset, dxpl_id, storage_size) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't retrieve chunked dataset allocated size") } /* end if */ else - ret_value = 0; + *storage_size = 0; break; case H5D_CONTIGUOUS: /* Datasets which are not allocated yet are using no space on disk */ if((*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) - ret_value = dset->shared->layout.storage.u.contig.size; + *storage_size = dset->shared->layout.storage.u.contig.size; else - ret_value = 0; + *storage_size = 0; break; case H5D_COMPACT: - ret_value = dset->shared->layout.storage.u.compact.size; + *storage_size = dset->shared->layout.storage.u.compact.size; break; case H5D_LAYOUT_ERROR: case H5D_NLAYOUTS: default: - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, 0) -} /* end H5D_get_storage_size() */ +} /* end H5D__get_storage_size() */ /*------------------------------------------------------------------------- - * Function: H5D_get_offset + * Function: H5D__get_offset * - * Purpose: Private function for H5D_get_offset. Returns the address + * Purpose: Private function for H5D__get_offset. Returns the address * of dataset in file. * * Return: Success: the address of dataset @@ -1861,11 +1860,11 @@ done: *------------------------------------------------------------------------- */ haddr_t -H5D_get_offset(const H5D_t *dset) +H5D__get_offset(const H5D_t *dset) { haddr_t ret_value = HADDR_UNDEF; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(dset); @@ -1890,11 +1889,11 @@ H5D_get_offset(const H5D_t *dset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_get_offset() */ +} /* end H5D__get_offset() */ /*------------------------------------------------------------------------- - * Function: H5D_iterate + * Function: H5D__iterate * * Purpose: Internal version of H5Diterate() * @@ -1908,12 +1907,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, +H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, void *operator_data) { herr_t ret_value; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(buf); @@ -1925,7 +1924,7 @@ H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, ret_value = H5S_select_iterate(buf, type_id, space, op, operator_data); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_iterate() */ +} /* end H5D__iterate() */ /*------------------------------------------------------------------------- @@ -1962,8 +1961,8 @@ H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf) if(H5T_vlen_get_alloc_info(plist_id,&vl_alloc_info) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info") - /* Call H5D_iterate with args, etc. */ - ret_value = H5D_iterate(buf, type_id, space ,H5T_vlen_reclaim, vl_alloc_info); + /* Call H5D__iterate with args, etc. */ + ret_value = H5D__iterate(buf, type_id, space ,H5T_vlen_reclaim, vl_alloc_info); done: FUNC_LEAVE_NOAPI(ret_value) @@ -1971,7 +1970,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_vlen_get_buf_size_alloc + * Function: H5D__vlen_get_buf_size_alloc * * Purpose: This routine makes certain there is enough space in the temporary * buffer for the new data to read in. All the VL data read in is actually @@ -1986,12 +1985,12 @@ done: *------------------------------------------------------------------------- */ void * -H5D_vlen_get_buf_size_alloc(size_t size, void *info) +H5D__vlen_get_buf_size_alloc(size_t size, void *info) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)info; void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Get a temporary pointer to space for the VL data */ if((vlen_bufsize->vl_tbuf = H5FL_BLK_REALLOC(vlen_vl_buf, vlen_bufsize->vl_tbuf, size)) != NULL) @@ -2001,11 +2000,11 @@ H5D_vlen_get_buf_size_alloc(size_t size, void *info) ret_value = vlen_bufsize->vl_tbuf; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_vlen_get_buf_size_alloc() */ +} /* end H5D__vlen_get_buf_size_alloc() */ /*------------------------------------------------------------------------- - * Function: H5D_vlen_get_buf_size + * Function: H5D__vlen_get_buf_size * * Purpose: This routine checks the number of bytes required to store a single * element from a dataset in memory, creating a selection with just the @@ -2031,13 +2030,13 @@ H5D_vlen_get_buf_size_alloc(size_t size, void *info) */ /* ARGSUSED */ herr_t -H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) +H5D__vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data) { H5D_vlen_bufsize_t *vlen_bufsize = (H5D_vlen_bufsize_t *)op_data; H5T_t *dt; /* Datatype for operation */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(op_data); HDassert(H5I_DATATYPE == H5I_get_type(type_id)); @@ -2060,11 +2059,11 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, co done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_vlen_get_buf_size() */ +} /* end H5D__vlen_get_buf_size() */ /*------------------------------------------------------------------------- - * Function: H5D_check_filters + * Function: H5D__check_filters * * Purpose: Check if the filters have be initialized for the dataset * @@ -2076,12 +2075,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_check_filters(H5D_t *dataset) +H5D__check_filters(H5D_t *dataset) { H5O_fill_t *fill; /* Dataset's fill value */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dataset); @@ -2114,14 +2113,14 @@ H5D_check_filters(H5D_t *dataset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_check_filters() */ +} /* end H5D__check_filters() */ /*------------------------------------------------------------------------- - * Function: H5D_set_extent + * Function: H5D__set_extent * * Purpose: Based on H5D_extend, allows change to a lower dimension, - * calls H5S_set_extent and H5D_chunk_prune_by_extent instead + * calls H5S_set_extent and H5D__chunk_prune_by_extent instead * * Return: Non-negative on success, negative on failure * @@ -2131,7 +2130,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) +H5D__set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) { H5S_t *space; /* Dataset's dataspace */ int rank; /* Dataspace # of dimensions */ @@ -2139,7 +2138,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) htri_t changed; /* Whether the dataspace changed size */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Check args */ HDassert(dset); @@ -2156,7 +2155,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "dataset has contiguous storage") /* Check if the filters in the DCPL will need to encode, and if so, can they? */ - if(H5D_check_filters(dset) < 0) + if(H5D__check_filters(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't apply filters") /* Get the data space */ @@ -2190,15 +2189,15 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) */ /* Update the index values for the cached chunks for this dataset */ if(H5D_CHUNKED == dset->shared->layout.type) { - if(H5D_chunk_set_info(dset) < 0) + if(H5D__chunk_set_info(dset) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to update # of chunks") - if(H5D_chunk_update_cache(dset, dxpl_id) < 0) + if(H5D__chunk_update_cache(dset, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update cached chunk indices") } /* end if */ /* Allocate space for the new parts of the dataset, if appropriate */ if(expand && dset->shared->dcpl_cache.fill.alloc_time == H5D_ALLOC_TIME_EARLY) - if(H5D_alloc_storage(dset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) + if(H5D__alloc_storage(dset, dxpl_id, H5D_ALLOC_EXTEND, FALSE, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to extend dataset storage") /*------------------------------------------------------------------------- @@ -2210,22 +2209,22 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) if(shrink && H5D_CHUNKED == dset->shared->layout.type && (*dset->shared->layout.ops->is_space_alloc)(&dset->shared->layout.storage)) { /* Remove excess chunks */ - if(H5D_chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) + if(H5D__chunk_prune_by_extent(dset, dxpl_id, curr_dims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to remove chunks") } /* end if */ /* Mark the dataspace as dirty, for later writing to the file */ - if(H5D_mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) + if(H5D__mark(dset, dxpl_id, H5D_MARK_SPACE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "unable to mark dataspace as dirty") } /* end if */ done: FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_set_extent() */ +} /* end H5D__set_extent() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_sieve_buf + * Function: H5D__flush_sieve_buf * * Purpose: Flush any dataset sieve buffer info cached in memory * @@ -2238,11 +2237,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dataset); @@ -2262,11 +2261,11 @@ H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush_sieve_buf() */ +} /* end H5D__flush_sieve_buf() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_real + * Function: H5D__flush_real * * Purpose: Flush any dataset information cached in memory * @@ -2279,12 +2278,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) +H5D__flush_real(H5D_t *dataset, hid_t dxpl_id) { H5O_t *oh = NULL; /* Pointer to dataset's object header */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* Check args */ HDassert(dataset); @@ -2299,7 +2298,7 @@ H5D_flush_real(H5D_t *dataset, hid_t dxpl_id) /* Update the layout on disk, if it's been changed */ if(dataset->shared->layout_dirty) { - if(H5D_layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) + if(H5D__layout_oh_write(dataset, dxpl_id, oh, update_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to update layout/pline/efl info") dataset->shared->layout_dirty = FALSE; @@ -2333,11 +2332,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTUNPIN, FAIL, "unable to unpin dataset object header") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_flush_real() */ +} /* end H5D__flush_real() */ /*------------------------------------------------------------------------- - * Function: H5D_mark + * Function: H5D__mark * * Purpose: Mark some aspect of a dataset as dirty * @@ -2350,11 +2349,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) +H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR /* Check args */ HDassert(dataset); @@ -2367,11 +2366,11 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) dataset->shared->layout_dirty = TRUE; FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mark() */ +} /* end H5D__mark() */ /*------------------------------------------------------------------------- - * Function: H5D_flush_cb + * Function: H5D__flush_cb * * Purpose: Flush any dataset information cached in memory * @@ -2384,13 +2383,13 @@ H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags) *------------------------------------------------------------------------- */ static int -H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) +H5D__flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) { H5D_t *dataset = (H5D_t *)_dataset; /* Dataset pointer */ H5D_flush_ud_t *udata = (H5D_flush_ud_t *)_udata; /* User data for callback */ int ret_value = H5_ITER_CONT; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(dataset); @@ -2398,13 +2397,13 @@ H5D_flush_cb(void *_dataset, hid_t UNUSED id, void *_udata) /* Check for dataset in same file */ if(udata->f == dataset->oloc.file) { /* Flush the dataset's information */ - if(H5D_flush_real(dataset, udata->dxpl_id) < 0) + if(H5D__flush_real(dataset, udata->dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, H5_ITER_ERROR, "unable to flush cached dataset info") } /* end if */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_flush_cb() */ +} /* end H5D__flush_cb() */ /*------------------------------------------------------------------------- @@ -2436,7 +2435,7 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id) udata.dxpl_id = dxpl_id; /* Iterate over all the open datasets */ - if(H5I_iterate(H5I_DATASET, H5D_flush_cb, &udata, FALSE) < 0) + if(H5I_iterate(H5I_DATASET, H5D__flush_cb, &udata, FALSE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_BADITER, FAIL, "unable to flush cached dataset info") done: diff --git a/src/H5Dio.c b/src/H5Dio.c index 06e4417..e34452c 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -50,27 +50,27 @@ /********************/ /* Internal I/O routines */ -static herr_t H5D_read(H5D_t *dataset, hid_t mem_type_id, +static herr_t H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, void *buf/*out*/); -static herr_t H5D_write(H5D_t *dataset, hid_t mem_type_id, +static herr_t H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, const void *buf); /* Setup/teardown routines */ -static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, +static herr_t H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info); -static herr_t H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, +static herr_t H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info); #ifdef H5_HAVE_PARALLEL -static herr_t H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, +static herr_t H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); -static herr_t H5D_ioinfo_term(H5D_io_info_t *io_info); +static herr_t H5D__ioinfo_term(H5D_io_info_t *io_info); #endif /* H5_HAVE_PARALLEL */ -static herr_t H5D_typeinfo_term(const H5D_type_info_t *type_info); +static herr_t H5D__typeinfo_term(const H5D_type_info_t *type_info); /*********************/ @@ -170,7 +170,7 @@ H5Dread(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, buf = &fake_char; /* read raw data */ - if(H5D_read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) + if(H5D__read(dset, mem_type_id, mem_space, file_space, plist_id, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "can't read data") done: @@ -262,7 +262,7 @@ H5Dwrite(hid_t dset_id, hid_t mem_type_id, hid_t mem_space_id, buf = &fake_char; /* write raw data */ - if(H5D_write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) + if(H5D__write(dset, mem_type_id, mem_space, file_space, dxpl_id, buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "can't write data") done: @@ -271,7 +271,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5D_read + * Function: H5D__read * * Purpose: Reads (part of) a DATASET into application memory BUF. See * H5Dread() for complete details. @@ -284,7 +284,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, +H5D__read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, void *buf/*out*/) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ @@ -315,7 +315,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -329,11 +329,11 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Set up datatype info for operation */ - if(H5D_typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, FALSE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; @@ -412,7 +412,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_DONE(SUCCEED) /* Go fill the user's selection with the dataset's fill value */ - if(H5D_fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, type_info.mem_type, mem_space, dxpl_id) < 0) + if(H5D__fill(dataset->shared->dcpl_cache.fill.buf, dataset->shared->type, buf, type_info.mem_type, mem_space, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "filling buf failed") else HGOTO_DONE(SUCCEED) @@ -421,7 +421,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_READ; io_info.u.rbuf = buf; - if(H5D_ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") #ifdef H5_HAVE_PARALLEL io_info_init = TRUE; @@ -441,7 +441,7 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -456,11 +456,11 @@ done: #ifdef H5_HAVE_PARALLEL /* Shut down io_info struct */ if(io_info_init) - if(H5D_ioinfo_term(&io_info) < 0) + if(H5D__ioinfo_term(&io_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") #endif /*H5_HAVE_PARALLEL*/ /* Shut down datatype info for operation */ - if(type_info_init && H5D_typeinfo_term(&type_info) < 0) + if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") /* discard projected mem space if it was created */ @@ -469,11 +469,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_read() */ +} /* end H5D__read() */ /*------------------------------------------------------------------------- - * Function: H5D_write + * Function: H5D__write * * Purpose: Writes (part of) a DATASET to a file from application memory * BUF. See H5Dwrite() for complete details. @@ -486,7 +486,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, +H5D__write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dxpl_id, const void *buf) { H5D_chunk_map_t fm; /* Chunk file<->memory mapping */ @@ -517,7 +517,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, H5D_dxpl_cache_t *dxpl_cache = &_dxpl_cache; /* Data transfer property cache */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dataset->oloc.addr, FAIL) + FUNC_ENTER_STATIC_TAG(dxpl_id, dataset->oloc.addr, FAIL) /* check args */ HDassert(dataset && dataset->oloc.file); @@ -535,11 +535,11 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "no write intent on file") /* Fill the DXPL cache values for later use */ - if(H5D_get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) + if(H5D__get_dxpl_cache(dxpl_id, &dxpl_cache) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") /* Set up datatype info for operation */ - if(H5D_typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0) + if(H5D__typeinfo_init(dataset, dxpl_cache, dxpl_id, mem_type_id, TRUE, &type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up type info") type_info_init = TRUE; @@ -644,14 +644,14 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, full_overwrite = (hbool_t)((hsize_t)file_nelmts == nelmts ? TRUE : FALSE); /* Allocate storage */ - if(H5D_alloc_storage(dataset, dxpl_id, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0) + if(H5D__alloc_storage(dataset, dxpl_id, H5D_ALLOC_WRITE, full_overwrite, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") } /* end if */ /* Set up I/O operation */ io_info.op_type = H5D_IO_OP_WRITE; io_info.u.wbuf = buf; - if(H5D_ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) + if(H5D__ioinfo_init(dataset, dxpl_cache, dxpl_id, &type_info, &store, &io_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set up I/O operation") #ifdef H5_HAVE_PARALLEL io_info_init = TRUE; @@ -665,7 +665,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL /* Adjust I/O info for any parallel I/O */ - if(H5D_ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) + if(H5D__ioinfo_adjust(&io_info, dataset, dxpl_id, file_space, mem_space, &type_info, &fm) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to adjust I/O info for parallel I/O") #endif /*H5_HAVE_PARALLEL*/ @@ -697,11 +697,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down I/O op info") #ifdef H5_HAVE_PARALLEL /* Shut down io_info struct */ - if(io_info_init && H5D_ioinfo_term(&io_info) < 0) + if(io_info_init && H5D__ioinfo_term(&io_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "can't shut down io_info") #endif /*H5_HAVE_PARALLEL*/ /* Shut down datatype info for operation */ - if(type_info_init && H5D_typeinfo_term(&type_info) < 0) + if(type_info_init && H5D__typeinfo_term(&type_info) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down type info") /* discard projected mem space if it was created */ @@ -710,11 +710,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTCLOSEOBJ, FAIL, "unable to shut down projected memory dataspace") FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_write() */ +} /* end H5D__write() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_init + * Function: H5D__ioinfo_init * * Purpose: Routine for determining correct I/O operations for * each I/O action. @@ -727,10 +727,10 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, +H5D__ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5D_type_info_t *type_info, H5D_storage_t *store, H5D_io_info_t *io_info) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* check args */ HDassert(dset); @@ -758,15 +758,15 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, * If there is no data transform or type conversion then read directly into * the application's buffer. This saves at least one mem-to-mem copy. */ - io_info->io_ops.single_read = H5D_select_read; - io_info->io_ops.single_write = H5D_select_write; + io_info->io_ops.single_read = H5D__select_read; + io_info->io_ops.single_write = H5D__select_write; } /* end if */ else { /* * This is the general case (type conversion, usually). */ - io_info->io_ops.single_read = H5D_scatgath_read; - io_info->io_ops.single_write = H5D_scatgath_write; + io_info->io_ops.single_read = H5D__scatgath_read; + io_info->io_ops.single_write = H5D__scatgath_write; } /* end else */ #ifdef H5_HAVE_PARALLEL @@ -775,11 +775,11 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, #endif /* H5_HAVE_PARALLEL */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_ioinfo_init() */ +} /* end H5D__ioinfo_init() */ /*------------------------------------------------------------------------- - * Function: H5D_typeinfo_init + * Function: H5D__typeinfo_init * * Purpose: Routine for determining correct datatype information for * each I/O action. @@ -792,7 +792,7 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, *------------------------------------------------------------------------- */ static herr_t -H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, +H5D__typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, hid_t mem_type_id, hbool_t do_write, H5D_type_info_t *type_info) { @@ -800,7 +800,7 @@ H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, const H5T_t *dst_type; /* Destination datatype */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(type_info); @@ -931,12 +931,12 @@ H5D_typeinfo_init(const H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_typeinfo_init() */ +} /* end H5D__typeinfo_init() */ #ifdef H5_HAVE_PARALLEL /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_adjust + * Function: H5D__ioinfo_adjust * * Purpose: Adjust operation's I/O info for any parallel I/O * @@ -948,7 +948,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, +H5D__ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { @@ -957,7 +957,7 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, H5D_mpio_actual_io_mode_t actual_io_mode; /* performed io mode */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* check args */ HDassert(dset); @@ -997,7 +997,7 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI communicator") /* Check if we can set direct MPI-IO read/write functions */ - if((opt = H5D_mpio_opt_possible(io_info, file_space, mem_space, type_info, fm)) < 0) + if((opt = H5D__mpio_opt_possible(io_info, file_space, mem_space, type_info, fm)) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for direct IO dataspace ") /* Check if we can use the optimized parallel I/O routines */ @@ -1005,8 +1005,8 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, /* Override the I/O op pointers to the MPI-specific routines */ io_info->io_ops.multi_read = dset->shared->layout.ops->par_read; io_info->io_ops.multi_write = dset->shared->layout.ops->par_write; - io_info->io_ops.single_read = H5D_mpio_select_read; - io_info->io_ops.single_write = H5D_mpio_select_write; + io_info->io_ops.single_read = H5D__mpio_select_read; + io_info->io_ops.single_write = H5D__mpio_select_write; } /* end if */ else { /* If we won't be doing collective I/O, but the user asked for @@ -1024,11 +1024,11 @@ H5D_ioinfo_adjust(H5D_io_info_t *io_info, const H5D_t *dset, hid_t dxpl_id, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_adjust() */ +} /* end H5D__ioinfo_adjust() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_term + * Function: H5D__ioinfo_term * * Purpose: Common logic for terminating an I/O info object * (Only used for restoring MPI transfer mode currently) @@ -1041,11 +1041,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_term(H5D_io_info_t *io_info) +H5D__ioinfo_term(H5D_io_info_t *io_info) { herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check if we used the MPI VFD for the I/O */ if(io_info->using_mpi_vfd) { @@ -1078,13 +1078,13 @@ H5D_ioinfo_term(H5D_io_info_t *io_info) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_term() */ +} /* end H5D__ioinfo_term() */ #endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- - * Function: H5D_typeinfo_term + * Function: H5D__typeinfo_term * * Purpose: Common logic for terminating a type info object * @@ -1096,9 +1096,9 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_typeinfo_term(const H5D_type_info_t *type_info) +H5D__typeinfo_term(const H5D_type_info_t *type_info) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check for releasing datatype conversion & background buffers */ if(type_info->tconv_buf_allocated) { @@ -1111,5 +1111,5 @@ H5D_typeinfo_term(const H5D_type_info_t *type_info) } /* end if */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_typeinfo_term() */ +} /* end H5D__typeinfo_term() */ diff --git a/src/H5Dlayout.c b/src/H5Dlayout.c index 53d49aa..d7d7b88 100644 --- a/src/H5Dlayout.c +++ b/src/H5Dlayout.c @@ -61,7 +61,7 @@ /*------------------------------------------------------------------------- - * Function: H5D_layout_set_io_ops + * Function: H5D__layout_set_io_ops * * Purpose: Set the I/O operation function pointers for a dataset, * according to the dataset's layout @@ -74,11 +74,11 @@ *------------------------------------------------------------------------- */ herr_t -H5D_layout_set_io_ops(const H5D_t *dataset) +H5D__layout_set_io_ops(const H5D_t *dataset) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(dataset); @@ -112,11 +112,11 @@ H5D_layout_set_io_ops(const H5D_t *dataset) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_layout_set_io_ops() */ +} /* end H5D__layout_set_io_ops() */ /*------------------------------------------------------------------------- - * Function: H5D_layout_meta_size + * Function: H5D__layout_meta_size * * Purpose: Returns the size of the raw message in bytes except raw data * part for compact dataset. This function doesn't take into @@ -131,11 +131,11 @@ done: *------------------------------------------------------------------------- */ size_t -H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data) +H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data) { size_t ret_value; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check args */ HDassert(f); @@ -177,11 +177,11 @@ H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_layout_meta_size() */ +} /* end H5D__layout_meta_size() */ /*------------------------------------------------------------------------- - * Function: H5D_layout_oh_create + * Function: H5D__layout_oh_create * * Purpose: Create layout/pline/efl information for dataset * @@ -194,7 +194,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, +H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hid_t dapl_id) { H5O_layout_t *layout; /* Dataset's layout information */ @@ -202,7 +202,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hbool_t layout_init = FALSE; /* Flag to indicate that chunk information was initialized */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_TAG(dxpl_id, dset->oloc.addr, FAIL) + FUNC_ENTER_PACKAGE_TAG(dxpl_id, dset->oloc.addr, FAIL) /* Sanity checking */ HDassert(file); @@ -234,7 +234,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, * allocation until later. */ if(fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY) - if(H5D_alloc_storage(dset, dxpl_id, H5D_ALLOC_CREATE, FALSE, NULL) < 0) + if(H5D__alloc_storage(dset, dxpl_id, H5D_ALLOC_CREATE, FALSE, NULL) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize storage") /* Update external storage message, if it's used */ @@ -289,7 +289,7 @@ H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, /* Create layout message */ /* (Don't make layout message constant unless allocation time is early, since space may not be allocated) */ - /* (Note: this is relying on H5D_alloc_storage not calling H5O_msg_write during dataset creation) */ + /* (Note: this is relying on H5D__alloc_storage not calling H5O_msg_write during dataset creation) */ if(H5O_msg_append_oh(file, dxpl_id, oh, H5O_LAYOUT_ID, ((fill_prop->alloc_time == H5D_ALLOC_TIME_EARLY && H5D_COMPACT != layout->type) ? H5O_MSG_FLAG_CONSTANT : 0), 0, layout) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update layout") @@ -297,17 +297,17 @@ done: /* Error cleanup */ if(ret_value < 0) { if(dset->shared->layout.type == H5D_CHUNKED && layout_init) { - if(H5D_chunk_dest(file, dxpl_id, dset) < 0) + if(H5D__chunk_dest(file, dxpl_id, dset) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") } /* end if */ } /* end if */ FUNC_LEAVE_NOAPI_TAG(ret_value, FAIL) -} /* end H5D_layout_oh_create() */ +} /* end H5D__layout_oh_create() */ /*------------------------------------------------------------------------- - * Function: H5D_layout_oh_read + * Function: H5D__layout_oh_read * * Purpose: Read layout/pline/efl information for dataset * @@ -320,12 +320,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) +H5D__layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist) { htri_t msg_exists; /* Whether a particular type of message exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checking */ HDassert(dataset); @@ -432,7 +432,7 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t case H5D_CHUNKED: /* Initialize the chunk cache for the dataset */ - if(H5D_chunk_init(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) + if(H5D__chunk_init(dataset->oloc.file, dxpl_id, dataset, dapl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't initialize chunk cache") break; @@ -447,11 +447,11 @@ H5D_layout_oh_read(H5D_t *dataset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_layout_oh_read() */ +} /* end H5D__layout_oh_read() */ /*------------------------------------------------------------------------- - * Function: H5D_layout_oh_write + * Function: H5D__layout_oh_write * * Purpose: Write layout/pline/efl information for dataset * @@ -464,11 +464,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags) +H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity checking */ HDassert(dataset); @@ -480,5 +480,5 @@ H5D_layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_fl done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_layout_oh_write() */ +} /* end H5D__layout_oh_write() */ diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index e657f8f..45cf6a1 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -100,33 +100,32 @@ typedef struct H5D_chunk_addr_info_t { /********************/ /* Local Prototypes */ /********************/ -static herr_t H5D_chunk_collective_io(H5D_io_info_t *io_info, +static herr_t H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm); -static herr_t H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, +static herr_t H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist); -static herr_t H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, +static herr_t H5D__multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist); -static herr_t H5D_link_chunk_collective_io(H5D_io_info_t *io_info, +static herr_t H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk); -static herr_t H5D_inter_collective_io(H5D_io_info_t *io_info, +static herr_t H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5S_t *file_space, const H5S_t *mem_space); -static herr_t H5D_final_collective_io(H5D_io_info_t *io_info, +static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type); -static herr_t H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, +static herr_t H5D__sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int many_chunk_opt); -static herr_t H5D_obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, +static herr_t H5D__obtain_mpio_mode(H5D_io_info_t *io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]); -static herr_t H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, +static herr_t H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_xfer_t xfer_mode); -static herr_t H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, +static herr_t H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_collective_opt_t coll_opt_mode); -static herr_t H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, +static herr_t H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *min_chunkf); -static int H5D_cmp_chunk_addr(const void *addr1, const void *addr2); -static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, +static herr_t H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *sum_chunkf); @@ -141,7 +140,7 @@ static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, /*------------------------------------------------------------------------- - * Function: H5D_mpio_opt_possible + * Function: H5D__mpio_opt_possible * * Purpose: Checks if an direct I/O transfer is possible between memory and * the file. @@ -155,7 +154,7 @@ static herr_t H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, *------------------------------------------------------------------------- */ htri_t -H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, +H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm) { @@ -164,7 +163,7 @@ H5D_mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, int mpi_code; /* MPI error code */ htri_t ret_value = TRUE; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(io_info); @@ -243,11 +242,11 @@ broadcast: done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_mpio_opt_possible() */ +} /* H5D__mpio_opt_possible() */ /*------------------------------------------------------------------------- - * Function: H5D_mpio_select_read + * Function: H5D__mpio_select_read * * Purpose: MPI-IO function to read directly from app buffer to file. * @@ -258,13 +257,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, +H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) { const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); if(H5F_block_read(io_info->dset->oloc.file, H5FD_MEM_DRAW, store_contig->dset_addr, (size_t)mpi_buf_count, io_info->dxpl_id, io_info->u.rbuf) < 0) @@ -272,11 +271,11 @@ H5D_mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mpio_select_read() */ +} /* end H5D__mpio_select_read() */ /*------------------------------------------------------------------------- - * Function: H5D_mpio_select_write + * Function: H5D__mpio_select_write * * Purpose: MPI-IO function to write directly from app buffer to file. * @@ -287,13 +286,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, +H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED *type_info, hsize_t mpi_buf_count, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space) { const H5D_contig_storage_t *store_contig = &(io_info->store->contig); /* Contiguous storage info for this I/O operation */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /*OKAY: CAST DISCARDS CONST QUALIFIER*/ H5_CHECK_OVERFLOW(mpi_buf_count, hsize_t, size_t); @@ -302,11 +301,11 @@ H5D_mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t UNUSED done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mpio_select_write() */ +} /* end H5D__mpio_select_write() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_xfer_mode + * Function: H5D__ioinfo_xfer_mode * * Purpose: Switch to between collective & independent MPI I/O * @@ -318,12 +317,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, +H5D__ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_xfer_t xfer_mode) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Change the xfer_mode */ io_info->dxpl_cache->xfer_mode = xfer_mode; @@ -340,17 +339,17 @@ H5D_ioinfo_xfer_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, HDassert(xfer_mode == H5FD_MPIO_COLLECTIVE); /* Set the pointers to the MPI-specific routines */ - io_info->io_ops.single_read = H5D_mpio_select_read; - io_info->io_ops.single_write = H5D_mpio_select_write; + io_info->io_ops.single_read = H5D__mpio_select_read; + io_info->io_ops.single_write = H5D__mpio_select_write; } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_xfer_mode() */ +} /* end H5D__ioinfo_xfer_mode() */ /*------------------------------------------------------------------------- - * Function: H5D_ioinfo_coll_opt_mode + * Function: H5D__ioinfo_coll_opt_mode * * Purpose: Switch between using collective & independent MPI I/O w/file * set view @@ -363,12 +362,12 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, +H5D__ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, H5FD_mpio_collective_opt_t coll_opt_mode) { herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Change the optimal xfer_mode */ io_info->dxpl_cache->coll_opt_mode = coll_opt_mode; @@ -377,11 +376,11 @@ H5D_ioinfo_coll_opt_mode(H5D_io_info_t *io_info, H5P_genplist_t *dx_plist, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_ioinfo_coll_opt_mode() */ +} /* end H5D__ioinfo_coll_opt_mode() */ /*------------------------------------------------------------------------- - * Function: H5D_mpio_get_min_chunk + * Function: H5D__mpio_get_min_chunk * * Purpose: Routine for obtaining minimum number of chunks to cover * hyperslab selection selected by all processors. @@ -394,14 +393,14 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, +H5D__mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *min_chunkf) { int num_chunkf; /* Number of chunks to iterate over */ int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the number of chunks to perform I/O on */ num_chunkf = H5SL_count(fm->sel_chunks); @@ -412,11 +411,11 @@ H5D_mpio_get_min_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mpio_get_min_chunk() */ +} /* end H5D__mpio_get_min_chunk() */ /*------------------------------------------------------------------------- - * Function: H5D_mpio_get_sum_chunk + * Function: H5D__mpio_get_sum_chunk * * Purpose: Routine for obtaining total number of chunks to cover * hyperslab selection selected by all processors. @@ -429,7 +428,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, +H5D__mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int *sum_chunkf) { int num_chunkf; /* Number of chunks to iterate over */ @@ -437,7 +436,7 @@ H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the number of chunks to perform I/O on */ num_chunkf = 0; @@ -450,11 +449,11 @@ H5D_mpio_get_sum_chunk(const H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_mpio_get_sum_chunk() */ +} /* end H5D__mpio_get_sum_chunk() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_collective_read + * Function: H5D__contig_collective_read * * Purpose: Reads directly from contiguous data in file into application * memory using collective I/O. @@ -467,7 +466,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { @@ -475,14 +474,14 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ - if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) + if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "couldn't finish shared collective MPI-IO") /* Obtain the data transfer properties */ @@ -497,11 +496,11 @@ H5D_contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_i done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_collective_read() */ +} /* end H5D__contig_collective_read() */ /*------------------------------------------------------------------------- - * Function: H5D_contig_collective_write + * Function: H5D__contig_collective_write * * Purpose: Write directly to contiguous data in file from application * memory using collective I/O. @@ -514,7 +513,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t UNUSED *fm) { @@ -522,14 +521,14 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ H5P_genplist_t *dx_plist; /* Pointer to DXPL */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file)); HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER)); /* Call generic internal collective I/O routine */ - if(H5D_inter_collective_io(io_info, type_info, file_space, mem_space) < 0) + if(H5D__inter_collective_io(io_info, type_info, file_space, mem_space) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "couldn't finish shared collective MPI-IO") /* Obtain the data transfer properties */ @@ -544,11 +543,11 @@ H5D_contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_contig_collective_write() */ +} /* end H5D__contig_collective_write() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_io + * Function: H5D__chunk_collective_io * * Purpose: Routine for * 1) choose an IO option: @@ -578,7 +577,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm) { H5P_genplist_t *dx_plist; /* Pointer to DXPL */ @@ -592,7 +591,7 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info #endif herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(io_info); @@ -614,7 +613,7 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info unsigned one_link_chunk_io_threshold; /* Threshhold to use single collective I/O for all chunks */ int mpi_size; /* Number of processes in MPI job */ - if(H5D_mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) + if(H5D__mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to obtain the total chunk number of all processes"); if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi size") @@ -682,7 +681,7 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - if(H5D_link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0) + if(H5D__link_chunk_collective_io(io_info, type_info, fm, sum_chunk) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish linked chunk MPI-IO") /* Set the actual io mode property. */ @@ -696,7 +695,7 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - if(H5D_multi_chunk_collective_io_no_opt(io_info, type_info, fm, dx_plist) < 0) + if(H5D__multi_chunk_collective_io_no_opt(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish multiple chunk MPI-IO") } /* end if */ else { /*multiple chunk IOs with opt */ @@ -704,17 +703,17 @@ H5D_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info if(H5P_set(dx_plist, H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_NAME, &actual_chunk_opt_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "couldn't set actual chunk opt mode property") - if(H5D_multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) + if(H5D__multi_chunk_collective_io(io_info, type_info, fm, dx_plist) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish optimized multiple chunk MPI-IO") } /* end else */ done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_collective_io */ +} /* end H5D__chunk_collective_io */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_read + * Function: H5D__chunk_collective_read * * Purpose: Reads directly from chunks in file into application memory * using collective I/O. @@ -727,25 +726,25 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Call generic selection operation */ - if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) + if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_collective_read() */ +} /* end H5D__chunk_collective_read() */ /*------------------------------------------------------------------------- - * Function: H5D_chunk_collective_write + * Function: H5D__chunk_collective_write * * Purpose: Write directly to chunks in file from application memory * using collective I/O. @@ -758,25 +757,25 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t UNUSED nelmts, const H5S_t UNUSED *file_space, const H5S_t UNUSED *mem_space, H5D_chunk_map_t *fm) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Call generic selection operation */ - if(H5D_chunk_collective_io(io_info, type_info, fm) < 0) + if(H5D__chunk_collective_io(io_info, type_info, fm) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_chunk_collective_write() */ +} /* end H5D__chunk_collective_write() */ /*------------------------------------------------------------------------- - * Function: H5D_link_chunk_collective_io + * Function: H5D__link_chunk_collective_io * * Purpose: Routine for one collective IO with one MPI derived datatype to link with all chunks * @@ -793,7 +792,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, int sum_chunk) { H5D_chunk_addr_info_t *chunk_addr_info_array = NULL; @@ -815,11 +814,11 @@ H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the sum # of chunks, if not already available */ if(sum_chunk < 0) { - if(H5D_mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) + if(H5D__mpio_get_sum_chunk(io_info, fm, &sum_chunk) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to obtain the total chunk number of all processes"); } /* end if */ @@ -842,7 +841,7 @@ H5D_link_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type HDmemset(coords, 0, sizeof(coords)); /* Look up address of chunk */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, coords, + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, coords, io_info->store->chunk.index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") ctg_store.contig.dset_addr = udata.addr; @@ -875,7 +874,7 @@ if(H5DEBUG(D)) #endif /* Perform I/O */ - if(H5D_inter_collective_io(io_info, type_info, fspace, mspace) < 0) + if(H5D__inter_collective_io(io_info, type_info, fspace, mspace) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") } /* end if */ else { @@ -919,7 +918,7 @@ if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"before sorting the chunk address \n"); #endif /* Sort the chunk address */ - if(H5D_sort_chunk(io_info, fm, chunk_addr_info_array, sum_chunk) < 0) + if(H5D__sort_chunk(io_info, fm, chunk_addr_info_array, sum_chunk) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSWAP, FAIL, "unable to sort chunk address") ctg_store.contig.dset_addr = chunk_addr_info_array[0].chunk_addr; @@ -982,7 +981,7 @@ if(H5DEBUG(D)) HGOTO_ERROR(H5E_DATASET, H5E_CANTALLOC, FAIL, "couldn't allocate total chunk address arraybuffer") /* Retrieve chunk address map */ - if(H5D_chunk_addrmap(io_info, total_chunk_addr_array) < 0) + if(H5D__chunk_addrmap(io_info, total_chunk_addr_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") /* Get chunk with lowest address */ @@ -1008,7 +1007,7 @@ if(H5DEBUG(D)) io_info->store = &ctg_store; /* Perform final collective I/O operation */ - if(H5D_final_collective_io(io_info, type_info, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) + if(H5D__final_collective_io(io_info, type_info, mpi_buf_count, &chunk_final_ftype, &chunk_final_mtype) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish MPI-IO") } /* end else */ @@ -1046,11 +1045,11 @@ if(H5DEBUG(D)) HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code) FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_link_chunk_collective_io */ +} /* end H5D__link_chunk_collective_io */ /*------------------------------------------------------------------------- - * Function: H5D_multi_chunk_collective_io + * Function: H5D__multi_chunk_collective_io * * Purpose: To do IO per chunk according to IO mode(collective/independent/none) * @@ -1067,7 +1066,7 @@ if(H5DEBUG(D)) *------------------------------------------------------------------------- */ static herr_t -H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { H5D_io_info_t ctg_io_info; /* Contiguous I/O info object */ @@ -1088,7 +1087,7 @@ H5D_multi_chunk_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *typ H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /* Local variable for tracking the I/O mode used. */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifdef H5Dmpio_DEBUG mpi_rank = H5F_mpi_get_rank(io_info->dset->oloc.file); @@ -1107,7 +1106,7 @@ if(H5DEBUG(D)) #endif /* Obtain IO option for each chunk */ - if(H5D_obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) + if(H5D__obtain_mpio_mode(io_info, fm, dx_plist, chunk_io_option, chunk_addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTRECV, FAIL, "unable to obtain MPIO mode") /* Set up contiguous I/O info object */ @@ -1181,12 +1180,12 @@ if(H5DEBUG(D)) /* Switch back to collective I/O */ if(last_xfer_mode != H5FD_MPIO_COLLECTIVE) { - if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) + if(H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") last_xfer_mode = H5FD_MPIO_COLLECTIVE; } /* end if */ if(last_coll_opt_mode != H5FD_MPIO_COLLECTIVE_IO) { - if(H5D_ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) + if(H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE_IO) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to collective I/O") last_coll_opt_mode = H5FD_MPIO_COLLECTIVE_IO; } /* end if */ @@ -1195,7 +1194,7 @@ if(H5DEBUG(D)) ctg_store.contig.dset_addr = chunk_addr[u]; /* Perform the I/O */ - if(H5D_inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) + if(H5D__inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") } /* end if */ else { /* possible independent IO for this chunk */ @@ -1220,7 +1219,7 @@ if(H5DEBUG(D)) /* Using independent I/O with file setview.*/ if(last_coll_opt_mode != H5FD_MPIO_INDIVIDUAL_IO) { - if(H5D_ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) + if(H5D__ioinfo_coll_opt_mode(io_info, dx_plist, H5FD_MPIO_INDIVIDUAL_IO) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to individual I/O") last_coll_opt_mode = H5FD_MPIO_INDIVIDUAL_IO; } /* end if */ @@ -1229,7 +1228,7 @@ if(H5DEBUG(D)) ctg_store.contig.dset_addr = chunk_addr[u]; /* Perform the I/O */ - if(H5D_inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) + if(H5D__inter_collective_io(&ctg_io_info, type_info, fspace, mspace) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish shared collective MPI-IO") #ifdef H5D_DEBUG if(H5DEBUG(D)) @@ -1249,11 +1248,11 @@ done: H5MM_xfree(chunk_addr); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_multi_chunk_collective_io */ +} /* end H5D__multi_chunk_collective_io */ /*------------------------------------------------------------------------- - * Function: H5D_multi_chunk_collective_io_no_opt + * Function: H5D__multi_chunk_collective_io_no_opt * * Purpose: To do collective IO without any optimization per chunk base * The internal independent IO inside HDF5 cannot handle @@ -1280,7 +1279,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, +H5D__multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist) { H5SL_node_t *chunk_node; /* Current node in chunk skip list */ @@ -1295,7 +1294,7 @@ H5D_multi_chunk_collective_io_no_opt(H5D_io_info_t *io_info, H5D_mpio_actual_io_mode_t actual_io_mode = H5D_MPIO_NO_COLLECTIVE; /*Local variable for tracking the I/O modes used. */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC #ifdef H5D_DEBUG if(H5DEBUG(D)) { @@ -1326,7 +1325,7 @@ if(H5DEBUG(D)) { io_info->store = &store; /* Get the min. # of chunks */ - if(H5D_mpio_get_min_chunk(io_info, fm, &min_chunk) < 0) + if(H5D__mpio_get_min_chunk(io_info, fm, &min_chunk) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get minimum number of chunk") HDassert(min_chunk >= 0); @@ -1360,7 +1359,7 @@ if(H5DEBUG(D)) { make_ind = TRUE; /* Retrieve the chunk's address */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") @@ -1372,14 +1371,14 @@ if(H5DEBUG(D)) { htri_t cacheable; /* Whether the chunk is cacheable */ /* Switch to independent I/O */ - if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) + if(H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_INDEPENDENT) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") /* Update the local variable tracking the dxpl's actual io mode */ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_INDEPENDENT; /* Load the chunk into cache and lock it. */ - if((cacheable = H5D_chunk_cacheable(io_info, udata.addr, + if((cacheable = H5D__chunk_cacheable(io_info, udata.addr, io_info->op_type == H5D_IO_OP_WRITE)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't tell if chunk is cacheable") if(cacheable) { @@ -1394,7 +1393,7 @@ if(H5DEBUG(D)) { entire_chunk = FALSE; /* Lock the chunk into the cache */ - if(NULL == (chunk = H5D_chunk_lock(io_info, &udata, entire_chunk))) + if(NULL == (chunk = H5D__chunk_lock(io_info, &udata, entire_chunk))) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk") /* Set up the storage buffer information for this chunk */ @@ -1427,7 +1426,7 @@ if(H5DEBUG(D)) { /* Release the cache lock on the chunk. */ if(chunk) - if(H5D_chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), chunk, accessed_bytes) < 0) + if(H5D__chunk_unlock(io_info, &udata, (io_info->op_type == H5D_IO_OP_WRITE), chunk, accessed_bytes) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk") } /* end if */ else { /*collective I/O */ @@ -1437,12 +1436,12 @@ if(H5DEBUG(D)) { /* Update the local variable tracking the dxpl's actual io Mode. */ actual_io_mode = actual_io_mode | H5D_MPIO_CHUNK_COLLECTIVE; - if(H5D_inter_collective_io(&ctg_io_info, type_info, chunk_info->fspace, chunk_info->mspace) < 0) + if(H5D__inter_collective_io(&ctg_io_info, type_info, chunk_info->fspace, chunk_info->mspace) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL,"couldn't finish shared collective MPI-IO") } /* end else */ if(make_coll) - if(H5D_ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) + if(H5D__ioinfo_xfer_mode(io_info, dx_plist, H5FD_MPIO_COLLECTIVE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't switch to independent I/O") /* Get the next chunk node in the skip list */ @@ -1455,11 +1454,11 @@ if(H5DEBUG(D)) { done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_multi_chunk_collective_io_no_opt */ +} /* end H5D__multi_chunk_collective_io_no_opt */ /*------------------------------------------------------------------------- - * Function: H5D_inter_collective_io + * Function: H5D__inter_collective_io * * Purpose: Routine for the shared part of collective IO between multiple chunk * collective IO and contiguous collective IO @@ -1472,7 +1471,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, const H5S_t *file_space, const H5S_t *mem_space) { int mpi_buf_count; /* # of MPI types */ @@ -1482,7 +1481,7 @@ H5D_inter_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info int mpi_code; /* MPI return code */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC if((file_space != NULL) && (mem_space != NULL)) { int mpi_file_count; /* Number of file "objects" to transfer */ @@ -1508,7 +1507,7 @@ if(H5DEBUG(D)) #endif /* Perform final collective I/O operation */ - if(H5D_final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, &mpi_file_type, &mpi_buf_type) < 0) + if(H5D__final_collective_io(io_info, type_info, (hsize_t)mpi_buf_count, &mpi_file_type, &mpi_buf_type) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTGET, FAIL, "couldn't finish collective MPI-IO") done: @@ -1524,11 +1523,11 @@ if(H5DEBUG(D)) #endif FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_inter_collective_io() */ +} /* end H5D__inter_collective_io() */ /*------------------------------------------------------------------------- - * Function: H5D_final_collective_io + * Function: H5D__final_collective_io * * Purpose: Routine for the common part of collective IO with different storages. * @@ -1540,13 +1539,13 @@ if(H5DEBUG(D)) *------------------------------------------------------------------------- */ static herr_t -H5D_final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) { hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Pass buf type, file type to the file driver. */ if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type) < 0) @@ -1573,11 +1572,39 @@ if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"ret_value before leaving final_collective_io=%d\n",ret_value); #endif FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_final_collective_io */ +} /* end H5D__final_collective_io */ /*------------------------------------------------------------------------- - * Function: H5D_sort_chunk + * Function: H5D__cmp_chunk_addr + * + * Purpose: Routine to compare chunk addresses + * + * Description: Callback for qsort() to compare chunk addresses + * + * Return: -1, 0, 1 + * + * Programmer: Muqun Yang + * Monday, Feb. 13th, 2006 + * + *------------------------------------------------------------------------- + */ +static int +H5D__cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) +{ + haddr_t addr1, addr2; + + FUNC_ENTER_STATIC_NOERR + + addr1 = ((const H5D_chunk_addr_info_t *)chunk_addr_info1)->chunk_addr; + addr2 = ((const H5D_chunk_addr_info_t *)chunk_addr_info2)->chunk_addr; + + FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) +} /* end H5D__cmp_chunk_addr() */ + + +/*------------------------------------------------------------------------- + * Function: H5D__sort_chunk * * Purpose: Routine to sort chunks in increasing order of chunk address * Each chunk address is also obtained. @@ -1602,7 +1629,7 @@ if(H5DEBUG(D)) *------------------------------------------------------------------------- */ static herr_t -H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, +H5D__sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, H5D_chunk_addr_info_t chunk_addr_info_array[], int sum_chunk) { H5SL_node_t *chunk_node; /* Current node in chunk skip list */ @@ -1617,7 +1644,7 @@ H5D_sort_chunk(H5D_io_info_t *io_info, const H5D_chunk_map_t *fm, int i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Retrieve # of MPI processes */ if((mpi_size = H5F_mpi_get_size(io_info->dset->oloc.file)) < 0) @@ -1658,7 +1685,7 @@ if(H5DEBUG(D)) HGOTO_ERROR(H5E_IO, H5E_MPI, FAIL, "unable to obtain mpi rank") if(mpi_rank == 0) { - if(H5D_chunk_addrmap(io_info, total_chunk_addr_array) < 0) + if(H5D__chunk_addrmap(io_info, total_chunk_addr_array) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") } /* end if */ @@ -1681,7 +1708,7 @@ if(H5DEBUG(D)) H5D_chunk_ud_t udata; /* User data for querying chunk info */ /* Get address of chunk */ - if(H5D_chunk_lookup(io_info->dset, io_info->dxpl_id, + if(H5D__chunk_lookup(io_info->dset, io_info->dxpl_id, chunk_info->coords, chunk_info->index, &udata) < 0) HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "couldn't get chunk info from skipped list") chunk_addr = udata.addr; @@ -1709,7 +1736,7 @@ if(H5DEBUG(D)) if(do_sort) { size_t num_chunks = H5SL_count(fm->sel_chunks); - HDqsort(chunk_addr_info_array, num_chunks, sizeof(chunk_addr_info_array[0]), H5D_cmp_chunk_addr); + HDqsort(chunk_addr_info_array, num_chunks, sizeof(chunk_addr_info_array[0]), H5D__cmp_chunk_addr); } /* end if */ done: @@ -1717,11 +1744,11 @@ done: H5MM_xfree(total_chunk_addr_array); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_sort_chunk() */ +} /* end H5D__sort_chunk() */ /*------------------------------------------------------------------------- - * Function: H5D_obtain_mpio_mode + * Function: H5D__obtain_mpio_mode * * Purpose: Routine to obtain each io mode(collective,independent or none) for each chunk; * Each chunk address is also obtained. @@ -1757,7 +1784,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, +H5D__obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, H5P_genplist_t *dx_plist, uint8_t assign_io_mode[], haddr_t chunk_addr[]) { int total_chunks; @@ -1780,7 +1807,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, #endif herr_t ret_value = SUCCEED; - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Assign the rank 0 to the root */ root = 0; @@ -1797,7 +1824,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, percent_nproc_per_chunk = H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_RATIO_NAME); chunk_opt_mode = (H5FD_mpio_chunk_opt_t)H5P_peek_unsigned(dx_plist, H5D_XFER_MPIO_CHUNK_OPT_HARD_NAME); if((chunk_opt_mode == H5FD_MPIO_CHUNK_MULTI_IO) || (percent_nproc_per_chunk == 0)) { - if(H5D_chunk_addrmap(io_info, chunk_addr) < 0) + if(H5D__chunk_addrmap(io_info, chunk_addr) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address"); for(ic = 0; ic < total_chunks; ic++) assign_io_mode[ic] = H5D_CHUNK_IO_MODE_COL; @@ -1837,7 +1864,7 @@ H5D_obtain_mpio_mode(H5D_io_info_t* io_info, H5D_chunk_map_t *fm, nproc_per_chunk = (int*)H5MM_calloc(total_chunks * sizeof(int)); /* calculating the chunk address */ - if(H5D_chunk_addrmap(io_info, chunk_addr) < 0) { + if(H5D__chunk_addrmap(io_info, chunk_addr) < 0) { HDfree(nproc_per_chunk); HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get chunk address") } /* end if */ @@ -1916,19 +1943,6 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_obtain_mpio_mode() */ - -static int -H5D_cmp_chunk_addr(const void *chunk_addr_info1, const void *chunk_addr_info2) -{ - haddr_t addr1, addr2; - - FUNC_ENTER_NOAPI_NOINIT_NOERR - - addr1 = ((const H5D_chunk_addr_info_t *)chunk_addr_info1)->chunk_addr; - addr2 = ((const H5D_chunk_addr_info_t *)chunk_addr_info2)->chunk_addr; - - FUNC_LEAVE_NOAPI(H5F_addr_cmp(addr1, addr2)) -} +} /* end H5D__obtain_mpio_mode() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Doh.c b/src/H5Doh.c index e6a715f..37b0f52 100644 --- a/src/H5Doh.c +++ b/src/H5Doh.c @@ -45,18 +45,17 @@ /********************/ /* Local Prototypes */ /********************/ -static void *H5O_dset_get_copy_file_udata(void); -static void H5O_dset_free_copy_file_udata(void *); -static htri_t H5O_dset_isa(H5O_t *loc); -static hid_t H5O_dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, +static void *H5O__dset_get_copy_file_udata(void); +static void H5O__dset_free_copy_file_udata(void *); +static htri_t H5O__dset_isa(H5O_t *loc); +static hid_t H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref); -static void *H5O_dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, +static void *H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id); -static H5O_loc_t *H5O_dset_get_oloc(hid_t obj_id); -static herr_t H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, +static H5O_loc_t *H5O__dset_get_oloc(hid_t obj_id); +static herr_t H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info); - -static herr_t H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id); +static herr_t H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id); /*********************/ @@ -77,14 +76,14 @@ static herr_t H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id); const H5O_obj_class_t H5O_OBJ_DATASET[1] = {{ H5O_TYPE_DATASET, /* object type */ "dataset", /* object name, for debugging */ - H5O_dset_get_copy_file_udata, /* get 'copy file' user data */ - H5O_dset_free_copy_file_udata, /* free 'copy file' user data */ - H5O_dset_isa, /* "isa" message */ - H5O_dset_open, /* open an object of this class */ - H5O_dset_create, /* create an object of this class */ - H5O_dset_get_oloc, /* get an object header location for an object */ - H5O_dset_bh_info, /* get the index & heap info for an object */ - H5O_dset_flush /* flush an opened object of this class */ + H5O__dset_get_copy_file_udata, /* get 'copy file' user data */ + H5O__dset_free_copy_file_udata, /* free 'copy file' user data */ + H5O__dset_isa, /* "isa" message */ + H5O__dset_open, /* open an object of this class */ + H5O__dset_create, /* create an object of this class */ + H5O__dset_get_oloc, /* get an object header location for an object */ + H5O__dset_bh_info, /* get the index & heap info for an object */ + H5O__dset_flush /* flush an opened object of this class */ }}; /* Declare a free list to manage the H5D_copy_file_ud_t struct */ @@ -92,7 +91,7 @@ H5FL_DEFINE(H5D_copy_file_ud_t); /*------------------------------------------------------------------------- - * Function: H5O_dset_get_copy_file_udata + * Function: H5O__dset_get_copy_file_udata * * Purpose: Allocates the user data needed for copying a dataset's * object header from file to file. @@ -107,11 +106,11 @@ H5FL_DEFINE(H5D_copy_file_ud_t); *------------------------------------------------------------------------- */ static void * -H5O_dset_get_copy_file_udata(void) +H5O__dset_get_copy_file_udata(void) { void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Allocate space for the 'copy file' user data for copying datasets */ if(NULL == (ret_value = H5FL_CALLOC(H5D_copy_file_ud_t))) @@ -119,11 +118,11 @@ H5O_dset_get_copy_file_udata(void) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_get_copy_file_udata() */ +} /* end H5O__dset_get_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_free_copy_file_udata + * Function: H5O__dset_free_copy_file_udata * * Purpose: Release the user data needed for copying a dataset's * object header from file to file. @@ -133,18 +132,14 @@ done: * Programmer: Quincey Koziol * Monday, November 21, 2005 * - * Modifications: Peter Cao - * Tuesday, December 27, 2005 - * Free filter pipeline for copying a dataset - * *------------------------------------------------------------------------- */ static void -H5O_dset_free_copy_file_udata(void *_udata) +H5O__dset_free_copy_file_udata(void *_udata) { H5D_copy_file_ud_t *udata = (H5D_copy_file_ud_t *)_udata; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Sanity check */ HDassert(udata); @@ -165,11 +160,11 @@ H5O_dset_free_copy_file_udata(void *_udata) udata = H5FL_FREE(H5D_copy_file_ud_t, udata); FUNC_LEAVE_NOAPI_VOID -} /* end H5O_dset_free_copy_file_udata() */ +} /* end H5O__dset_free_copy_file_udata() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_isa + * Function: H5O__dset_isa * * Purpose: Determines if an object has the requisite messages for being * a dataset. @@ -186,12 +181,12 @@ H5O_dset_free_copy_file_udata(void *_udata) *------------------------------------------------------------------------- */ static htri_t -H5O_dset_isa(H5O_t *oh) +H5O__dset_isa(H5O_t *oh) { htri_t exists; /* Flag if header message of interest exists */ htri_t ret_value = TRUE; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(oh); @@ -209,11 +204,11 @@ H5O_dset_isa(H5O_t *oh) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_isa() */ +} /* end H5O__dset_isa() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_open + * Function: H5O__dset_open * * Purpose: Open a dataset at a particular location * @@ -226,14 +221,14 @@ done: *------------------------------------------------------------------------- */ static hid_t -H5O_dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) +H5O__dset_open(const H5G_loc_t *obj_loc, hid_t lapl_id, hid_t dxpl_id, hbool_t app_ref) { H5D_t *dset = NULL; /* Dataset opened */ htri_t isdapl; /* lapl_id is a dapl */ hid_t dapl_id; /* dapl to use to open this dataset */ hid_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); @@ -263,11 +258,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_open() */ +} /* end H5O__dset_open() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_create + * Function: H5O__dset_create * * Purpose: Create a dataset in a file * @@ -280,13 +275,13 @@ done: *------------------------------------------------------------------------- */ static void * -H5O_dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) { H5D_obj_create_t *crt_info = (H5D_obj_create_t *)_crt_info; /* Dataset creation parameters */ H5D_t *dset = NULL; /* New dataset created */ void *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity checks */ HDassert(f); @@ -294,7 +289,7 @@ H5O_dset_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Create the the dataset */ - if(NULL == (dset = H5D_create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id, dxpl_id))) + if(NULL == (dset = H5D__create(f, crt_info->type_id, crt_info->space, crt_info->dcpl_id, crt_info->dapl_id, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to create dataset") /* Set up the new dataset's location */ @@ -312,11 +307,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataset") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_create() */ +} /* end H5O__dset_create() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_get_oloc + * Function: H5O__dset_get_oloc * * Purpose: Retrieve the object header location for an open object * @@ -329,12 +324,12 @@ done: *------------------------------------------------------------------------- */ static H5O_loc_t * -H5O_dset_get_oloc(hid_t obj_id) +H5O__dset_get_oloc(hid_t obj_id) { H5D_t *dset; /* Dataset opened */ H5O_loc_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Get the dataset */ if(NULL == (dset = (H5D_t *)H5I_object(obj_id))) @@ -346,11 +341,11 @@ H5O_dset_get_oloc(hid_t obj_id) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_get_oloc() */ +} /* end H5O__dset_get_oloc() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_bh_info + * Function: H5O__dset_bh_info * * Purpose: Returns the amount of btree storage that is used for chunked * dataset. @@ -364,7 +359,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) +H5O__dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) { H5O_layout_t layout; /* Data storage layout message */ H5O_pline_t pline; /* I/O pipeline message */ @@ -375,7 +370,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) htri_t exists; /* Flag if header message of interest exists */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Sanity check */ HDassert(f); @@ -388,7 +383,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) layout_read = TRUE; /* Check for chunked dataset storage */ - if(layout.type == H5D_CHUNKED && H5D_chunk_is_space_alloc(&layout.storage)) { + if(layout.type == H5D_CHUNKED && H5D__chunk_is_space_alloc(&layout.storage)) { /* Check for I/O pipeline message */ if((exists = H5O_msg_exists_oh(oh, H5O_PLINE_ID)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to read object header") @@ -400,7 +395,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) else HDmemset(&pline, 0, sizeof(pline)); - if(H5D_chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size)) < 0) + if(H5D__chunk_bh_info(f, dxpl_id, &layout, &pline, &(bh_info->index_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine chunked dataset btree info") } /* end if */ @@ -408,7 +403,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) if((exists = H5O_msg_exists_oh(oh, H5O_EFL_ID)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_NOTFOUND, FAIL, "unable to check for EFL message") - if(exists && H5D_efl_is_space_alloc(&layout.storage)) { + if(exists && H5D__efl_is_space_alloc(&layout.storage)) { /* Start with clean EFL info */ HDmemset(&efl, 0, sizeof(efl)); @@ -418,7 +413,7 @@ H5O_dset_bh_info(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5_ih_info_t *bh_info) efl_read = TRUE; /* Get size of local heap for EFL message's file list */ - if(H5D_efl_bh_info(f, dxpl_id, &efl, &(bh_info->heap_size)) < 0) + if(H5D__efl_bh_info(f, dxpl_id, &efl, &(bh_info->heap_size)) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't determine EFL heap info") } /* end if */ @@ -432,11 +427,11 @@ done: HDONE_ERROR(H5E_DATASET, H5E_CANTRESET, FAIL, "unable to reset external file list message") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_bh_info() */ +} /* end H5O__dset_bh_info() */ /*------------------------------------------------------------------------- - * Function: H5O_dset_flush + * Function: H5O__dset_flush * * Purpose: To flush any dataset information cached in memory * @@ -449,13 +444,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) +H5O__dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) { H5D_t *dset; /* Dataset opened */ H5O_type_t obj_type; /* Type of object at location */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC HDassert(obj_loc); HDassert(obj_loc->oloc); @@ -471,11 +466,12 @@ H5O_dset_flush(H5G_loc_t *obj_loc, hid_t dxpl_id) if(NULL == (dset = H5D_open(obj_loc, H5P_DATASET_ACCESS_DEFAULT, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, FAIL, "unable to open dataset") - if(H5D_flush_real(dset, dxpl_id) < 0) + if(H5D__flush_real(dset, dxpl_id) < 0) HDONE_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "unable to flush cached dataset info") done: if(dset && H5D_close(dset) < 0) - HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, NULL, "unable to release dataset") + HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataset") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5O_dset_flush() */ +} /* end H5O__dset_flush() */ + diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index 40317f3..b997423 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -527,135 +527,137 @@ H5_DLLVAR const H5D_chunk_ops_t H5D_COPS_BTREE[1]; /* Package Private Prototypes */ /******************************/ -H5_DLL H5D_t *H5D_create(H5F_t *file, hid_t type_id, const H5S_t *space, +H5_DLL H5D_t *H5D__create(H5F_t *file, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); H5_DLL H5D_t *H5D__create_named(const H5G_loc_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t lcpl_id, hid_t dcpl_id, hid_t dapl_id, hid_t dxpl_id); -H5_DLL herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, +H5_DLL herr_t H5D__get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); -H5_DLL herr_t H5D_alloc_storage(H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, +H5_DLL herr_t H5D__alloc_storage(H5D_t *dset, hid_t dxpl_id, H5D_time_alloc_t time_alloc, hbool_t full_overwrite, hsize_t old_dim[]); -H5_DLL hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id); -H5_DLL haddr_t H5D_get_offset(const H5D_t *dset); -H5_DLL herr_t H5D_iterate(void *buf, hid_t type_id, const H5S_t *space, +H5_DLL herr_t H5D__get_storage_size(H5D_t *dset, hid_t dxpl_id, hsize_t *storage_size); +H5_DLL haddr_t H5D__get_offset(const H5D_t *dset); +H5_DLL herr_t H5D__iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t op, void *operator_data); -H5_DLL void * H5D_vlen_get_buf_size_alloc(size_t size, void *info); -H5_DLL herr_t H5D_vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, +H5_DLL void *H5D__vlen_get_buf_size_alloc(size_t size, void *info); +H5_DLL herr_t H5D__vlen_get_buf_size(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *op_data); -H5_DLL herr_t H5D_check_filters(H5D_t *dataset); -H5_DLL herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); -H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); -H5_DLL herr_t H5D_flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); -H5_DLL herr_t H5D_mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); -H5_DLL herr_t H5D_flush_real(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D__check_filters(H5D_t *dataset); +H5_DLL herr_t H5D__set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id); +H5_DLL herr_t H5D__get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache); +H5_DLL herr_t H5D__flush_sieve_buf(H5D_t *dataset, hid_t dxpl_id); +H5_DLL herr_t H5D__mark(H5D_t *dataset, hid_t dxpl_id, unsigned flags); +H5_DLL herr_t H5D__flush_real(H5D_t *dataset, hid_t dxpl_id); /* Functions that perform direct serial I/O operations */ -H5_DLL herr_t H5D_select_read(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); -H5_DLL herr_t H5D_select_write(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Functions that perform scatter-gather serial I/O operations */ -H5_DLL herr_t H5D_scatter_mem(const void *_tscat_buf, +H5_DLL herr_t H5D__scatter_mem(const void *_tscat_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_buf); -H5_DLL herr_t H5D_scatgath_read(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); -H5_DLL herr_t H5D_scatgath_write(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* Functions that operate on dataset's layout information */ -H5_DLL herr_t H5D_layout_set_io_ops(const H5D_t *dataset); -H5_DLL size_t H5D_layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, +H5_DLL herr_t H5D__layout_set_io_ops(const H5D_t *dataset); +H5_DLL size_t H5D__layout_meta_size(const H5F_t *f, const H5O_layout_t *layout, hbool_t include_compact_data); -H5_DLL herr_t H5D_layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, +H5_DLL herr_t H5D__layout_oh_create(H5F_t *file, hid_t dxpl_id, H5O_t *oh, H5D_t *dset, hid_t dapl_id); -H5_DLL herr_t H5D_layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id, +H5_DLL herr_t H5D__layout_oh_read(H5D_t *dset, hid_t dxpl_id, hid_t dapl_id, H5P_genplist_t *plist); -H5_DLL herr_t H5D_layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, +H5_DLL herr_t H5D__layout_oh_write(H5D_t *dataset, hid_t dxpl_id, H5O_t *oh, unsigned update_flags); /* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D_contig_alloc(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5D__contig_alloc(H5F_t *f, hid_t dxpl_id, H5O_storage_contig_t *storage); -H5_DLL hbool_t H5D_contig_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D_contig_fill(H5D_t *dset, hid_t dxpl_id); -H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset); -H5_DLL herr_t H5D_contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5_DLL hbool_t H5D__contig_is_space_alloc(const H5O_storage_t *storage); +H5_DLL herr_t H5D__contig_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__contig_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -H5_DLL herr_t H5D_contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5_DLL herr_t H5D__contig_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -H5_DLL herr_t H5D_contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, +H5_DLL herr_t H5D__contig_copy(H5F_t *f_src, const H5O_storage_contig_t *storage_src, H5F_t *f_dst, H5O_storage_contig_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); +H5_DLL herr_t H5D__contig_delete(H5F_t *f, hid_t dxpl_id, + const H5O_storage_t *store); + /* Functions that operate on chunked dataset storage */ -H5_DLL htri_t H5D_chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, +H5_DLL htri_t H5D__chunk_cacheable(const H5D_io_info_t *io_info, haddr_t caddr, hbool_t write_op); -H5_DLL herr_t H5D_chunk_cinfo_cache_reset(H5D_chunk_cached_t *last); -H5_DLL herr_t H5D_chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); -H5_DLL herr_t H5D_chunk_set_info(const H5D_t *dset); -H5_DLL herr_t H5D_chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, +H5_DLL herr_t H5D__chunk_create(H5D_t *dset /*in,out*/, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_set_info(const H5D_t *dset); +H5_DLL herr_t H5D__chunk_init(H5F_t *f, hid_t dxpl_id, const H5D_t *dset, hid_t dapl_id); -H5_DLL hbool_t H5D_chunk_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D_chunk_lookup(const H5D_t *dset, hid_t dxpl_id, +H5_DLL hbool_t H5D__chunk_is_space_alloc(const H5O_storage_t *storage); +H5_DLL herr_t H5D__chunk_lookup(const H5D_t *dset, hid_t dxpl_id, const hsize_t *chunk_offset, hsize_t chunk_idx, H5D_chunk_ud_t *udata); -H5_DLL void *H5D_chunk_lock(const H5D_io_info_t *io_info, +H5_DLL void *H5D__chunk_lock(const H5D_io_info_t *io_info, H5D_chunk_ud_t *udata, hbool_t relax); -H5_DLL herr_t H5D_chunk_unlock(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__chunk_unlock(const H5D_io_info_t *io_info, const H5D_chunk_ud_t *udata, hbool_t dirty, void *chunk, uint32_t naccessed); -H5_DLL herr_t H5D_chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); -H5_DLL herr_t H5D_chunk_allocate(H5D_t *dset, hid_t dxpl_id, +H5_DLL herr_t H5D__chunk_allocated(H5D_t *dset, hid_t dxpl_id, hsize_t *nbytes); +H5_DLL herr_t H5D__chunk_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite, hsize_t old_dim[]); -H5_DLL herr_t H5D_chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, +H5_DLL herr_t H5D__chunk_prune_by_extent(H5D_t *dset, hid_t dxpl_id, const hsize_t *old_dim); #ifdef H5_HAVE_PARALLEL -H5_DLL herr_t H5D_chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); +H5_DLL herr_t H5D__chunk_addrmap(const H5D_io_info_t *io_info, haddr_t chunk_addr[]); #endif /* H5_HAVE_PARALLEL */ -H5_DLL herr_t H5D_chunk_update_cache(H5D_t *dset, hid_t dxpl_id); -H5_DLL herr_t H5D_chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, +H5_DLL herr_t H5D__chunk_update_cache(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__chunk_copy(H5F_t *f_src, H5O_storage_chunk_t *storage_src, H5O_layout_chunk_t *layout_src, H5F_t *f_dst, H5O_storage_chunk_t *storage_dst, const H5S_extent_t *ds_extent_src, const H5T_t *dt_src, const H5O_pline_t *pline_src, H5O_copy_t *cpy_info, hid_t dxpl_id); -H5_DLL herr_t H5D_chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, +H5_DLL herr_t H5D__chunk_bh_info(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout, const H5O_pline_t *pline, hsize_t *btree_size); -H5_DLL herr_t H5D_chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); -H5_DLL herr_t H5D_chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset); +H5_DLL herr_t H5D__chunk_dump_index(H5D_t *dset, hid_t dxpl_id, FILE *stream); +H5_DLL herr_t H5D__chunk_dest(H5F_t *f, hid_t dxpl_id, H5D_t *dset); +H5_DLL herr_t H5D__chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, + H5O_storage_t *store); #ifdef H5D_CHUNK_DEBUG -H5_DLL herr_t H5D_chunk_stats(const H5D_t *dset, hbool_t headers); +H5_DLL herr_t H5D__chunk_stats(const H5D_t *dset, hbool_t headers); #endif /* H5D_CHUNK_DEBUG */ /* Functions that operate on compact dataset storage */ -H5_DLL herr_t H5D_compact_fill(H5D_t *dset, hid_t dxpl_id); -H5_DLL herr_t H5D_compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, +H5_DLL herr_t H5D__compact_fill(H5D_t *dset, hid_t dxpl_id); +H5_DLL herr_t H5D__compact_copy(H5F_t *f_src, H5O_storage_compact_t *storage_src, H5F_t *f_dst, H5O_storage_compact_t *storage_dst, H5T_t *src_dtype, H5O_copy_t *cpy_info, hid_t dxpl_id); /* Functions that operate on EFL (External File List)*/ -H5_DLL hbool_t H5D_efl_is_space_alloc(const H5O_storage_t *storage); -H5_DLL herr_t H5D_efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, +H5_DLL hbool_t H5D__efl_is_space_alloc(const H5O_storage_t *storage); +H5_DLL herr_t H5D__efl_bh_info(H5F_t *f, hid_t dxpl_id, H5O_efl_t *efl, hsize_t *heap_size); /* Functions that perform fill value operations on datasets */ -H5_DLL herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf, +H5_DLL herr_t H5D__fill(const void *fill, const H5T_t *fill_type, void *buf, const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id); -H5_DLL herr_t H5D_fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, +H5_DLL herr_t H5D__fill_init(H5D_fill_buf_info_t *fb_info, void *caller_fill_buf, H5MM_allocate_t alloc_func, void *alloc_info, H5MM_free_t free_func, void *free_info, const H5O_fill_t *fill, const H5T_t *dset_type, hid_t dset_type_id, size_t nelmts, size_t min_buf_size, hid_t dxpl_id); -H5_DLL herr_t H5D_fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, +H5_DLL herr_t H5D__fill_refill_vl(H5D_fill_buf_info_t *fb_info, size_t nelmts, hid_t dxpl_id); -H5_DLL herr_t H5D_fill_release(H5D_fill_buf_info_t *fb_info); -H5_DLL herr_t H5D_fill_term(H5D_fill_buf_info_t *fb_info); +H5_DLL herr_t H5D__fill_term(H5D_fill_buf_info_t *fb_info); #ifdef H5_HAVE_PARALLEL @@ -665,34 +667,34 @@ H5_DLL herr_t H5D_fill_term(H5D_fill_buf_info_t *fb_info); #endif /*H5Dmpio_DEBUG*/ #endif/*H5S_DEBUG*/ /* MPI-IO function to read, it will select either regular or irregular read */ -H5_DLL herr_t H5D_mpio_select_read(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__mpio_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* MPI-IO function to write, it will select either regular or irregular read */ -H5_DLL herr_t H5D_mpio_select_write(const H5D_io_info_t *io_info, +H5_DLL herr_t H5D__mpio_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); /* MPI-IO functions to handle contiguous collective IO */ -H5_DLL herr_t H5D_contig_collective_read(H5D_io_info_t *io_info, +H5_DLL herr_t H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -H5_DLL herr_t H5D_contig_collective_write(H5D_io_info_t *io_info, +H5_DLL herr_t H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); /* MPI-IO functions to handle chunked collective IO */ -H5_DLL herr_t H5D_chunk_collective_read(H5D_io_info_t *io_info, +H5_DLL herr_t H5D__chunk_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); -H5_DLL herr_t H5D_chunk_collective_write(H5D_io_info_t *io_info, +H5_DLL herr_t H5D__chunk_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space, H5D_chunk_map_t *fm); /* MPI-IO function to check if a direct I/O transfer is possible between * memory and the file */ -H5_DLL htri_t H5D_mpio_opt_possible(const H5D_io_info_t *io_info, +H5_DLL htri_t H5D__mpio_opt_possible(const H5D_io_info_t *io_info, const H5S_t *file_space, const H5S_t *mem_space, const H5D_type_info_t *type_info, const H5D_chunk_map_t *fm); @@ -700,9 +702,9 @@ H5_DLL htri_t H5D_mpio_opt_possible(const H5D_io_info_t *io_info, /* Testing functions */ #ifdef H5D_TESTING -H5_DLL herr_t H5D_layout_version_test(hid_t did, unsigned *version); -H5_DLL herr_t H5D_layout_contig_size_test(hid_t did, hsize_t *size); -H5_DLL herr_t H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); +H5_DLL herr_t H5D__layout_version_test(hid_t did, unsigned *version); +H5_DLL herr_t H5D__layout_contig_size_test(hid_t did, hsize_t *size); +H5_DLL herr_t H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused); #endif /* H5D_TESTING */ #endif /*_H5Dpkg_H*/ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 48966db..2211f79 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -169,14 +169,8 @@ H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id); H5_DLL herr_t H5D_vlen_reclaim(hid_t type_id, H5S_t *space, hid_t plist_id, void *buf); -/* Functions that operate on contiguous storage */ -H5_DLL herr_t H5D_contig_delete(H5F_t *f, hid_t dxpl_id, - const H5O_storage_t *store); - /* Functions that operate on chunked storage */ H5_DLL herr_t H5D_chunk_idx_reset(H5O_storage_chunk_t *storage, hbool_t reset_addr); -H5_DLL herr_t H5D_chunk_delete(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - H5O_storage_t *store); /* Functions that operate on indexed storage */ H5_DLL herr_t H5D_btree_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, diff --git a/src/H5Dscatgath.c b/src/H5Dscatgath.c index 7758619..49b6132 100644 --- a/src/H5Dscatgath.c +++ b/src/H5Dscatgath.c @@ -42,19 +42,19 @@ /********************/ /* Local Prototypes */ /********************/ -static size_t H5D_gather_file(const H5D_io_info_t *io_info, - const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, - void *buf); -static herr_t H5D_scatter_file(const H5D_io_info_t *io_info, +static herr_t H5D__scatter_file(const H5D_io_info_t *io_info, const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, const void *buf); -static size_t H5D_gather_mem(const void *_buf, +static size_t H5D__gather_file(const H5D_io_info_t *io_info, + const H5S_t *file_space, H5S_sel_iter_t *file_iter, size_t nelmts, + void *buf); +static size_t H5D__gather_mem(const void *_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/); -static herr_t H5D_compound_opt_read(size_t nelmts, const H5S_t *mem_space, +static herr_t H5D__compound_opt_read(size_t nelmts, const H5S_t *mem_space, H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, const H5D_type_info_t *type_info, void *user_buf/*out*/); -static herr_t H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); +static herr_t H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info); /*********************/ @@ -75,7 +75,7 @@ H5FL_SEQ_EXTERN(hsize_t); /*------------------------------------------------------------------------- - * Function: H5D_scatter_file + * Function: H5D__scatter_file * * Purpose: Scatters dataset elements from the type conversion buffer BUF * to the file F where the data points are arranged according to @@ -91,7 +91,7 @@ H5FL_SEQ_EXTERN(hsize_t); *------------------------------------------------------------------------- */ static herr_t -H5D_scatter_file(const H5D_io_info_t *_io_info, +H5D__scatter_file(const H5D_io_info_t *_io_info, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const void *_buf) { @@ -108,7 +108,7 @@ H5D_scatter_file(const H5D_io_info_t *_io_info, size_t nelem; /* Number of elements used in sequences */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(_io_info); @@ -165,11 +165,11 @@ done: off = H5FL_SEQ_FREE(hsize_t, off); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_scatter_file() */ +} /* H5D__scatter_file() */ /*------------------------------------------------------------------------- - * Function: H5D_gather_file + * Function: H5D__gather_file * * Purpose: Gathers data points from file F and accumulates them in the * type conversion buffer BUF. The LAYOUT argument describes @@ -190,7 +190,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5D_gather_file(const H5D_io_info_t *_io_info, +H5D__gather_file(const H5D_io_info_t *_io_info, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, void *_buf/*out*/) { @@ -207,7 +207,7 @@ H5D_gather_file(const H5D_io_info_t *_io_info, size_t nelem; /* Number of elements used in sequences */ size_t ret_value = nelmts; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(_io_info); @@ -266,11 +266,11 @@ done: off = H5FL_SEQ_FREE(hsize_t, off); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_gather_file() */ +} /* H5D__gather_file() */ /*------------------------------------------------------------------------- - * Function: H5D_scatter_mem + * Function: H5D__scatter_mem * * Purpose: Scatters NELMTS data points from the scatter buffer * TSCAT_BUF to the application buffer BUF. Each element is @@ -285,7 +285,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_scatter_mem (const void *_tscat_buf, const H5S_t *space, +H5D__scatter_mem (const void *_tscat_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_buf/*out*/) { @@ -301,7 +301,7 @@ H5D_scatter_mem (const void *_tscat_buf, const H5S_t *space, size_t nelem; /* Number of elements used in sequences */ herr_t ret_value = SUCCEED; /* Number of elements scattered */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(tscat_buf); @@ -351,11 +351,11 @@ done: off = H5FL_SEQ_FREE(hsize_t, off); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_scatter_mem() */ +} /* H5D__scatter_mem() */ /*------------------------------------------------------------------------- - * Function: H5D_gather_mem + * Function: H5D__gather_mem * * Purpose: Gathers dataset elements from application memory BUF and * copies them into the gather buffer TGATH_BUF. @@ -372,7 +372,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5D_gather_mem(const void *_buf, const H5S_t *space, +H5D__gather_mem(const void *_buf, const H5S_t *space, H5S_sel_iter_t *iter, size_t nelmts, const H5D_dxpl_cache_t *dxpl_cache, void *_tgath_buf/*out*/) { @@ -388,7 +388,7 @@ H5D_gather_mem(const void *_buf, const H5S_t *space, size_t nelem; /* Number of elements used in sequences */ size_t ret_value = nelmts; /* Number of elements gathered */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(buf); @@ -438,11 +438,11 @@ done: off = H5FL_SEQ_FREE(hsize_t, off); FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_gather_mem() */ +} /* H5D__gather_mem() */ /*------------------------------------------------------------------------- - * Function: H5D_scatgath_read + * Function: H5D__scatgath_read * * Purpose: Perform scatter/gather ead from a contiguous [piece of a] dataset. * @@ -454,7 +454,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ @@ -469,7 +469,7 @@ H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info size_t smine_nelmts; /*elements per strip */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(io_info); @@ -510,7 +510,7 @@ H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info /* * Gather data */ - n = H5D_gather_file(io_info, file_space, &file_iter, smine_nelmts, + n = H5D__gather_file(io_info, file_space, &file_iter, smine_nelmts, type_info->tconv_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") @@ -520,13 +520,13 @@ H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info * bypass the rest of steps. */ if(type_info->cmpd_subset && H5T_SUBSET_FALSE != type_info->cmpd_subset->subset) { - if(H5D_compound_opt_read(smine_nelmts, mem_space, &mem_iter, dxpl_cache, + if(H5D__compound_opt_read(smine_nelmts, mem_space, &mem_iter, dxpl_cache, type_info, buf /*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ else { if(H5T_BKG_YES == type_info->need_bkg) { - n = H5D_gather_mem(buf, mem_space, &bkg_iter, smine_nelmts, + n = H5D__gather_mem(buf, mem_space, &bkg_iter, smine_nelmts, dxpl_cache, type_info->bkg_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "mem gather failed") @@ -548,7 +548,7 @@ H5D_scatgath_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info /* * Scatter the data into memory. */ - if(H5D_scatter_mem(type_info->tconv_buf, mem_space, &mem_iter, + if(H5D__scatter_mem(type_info->tconv_buf, mem_space, &mem_iter, smine_nelmts, dxpl_cache, buf/*out*/) < 0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") } /* end else */ @@ -570,11 +570,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_scatgath_read() */ +} /* end H5D__scatgath_read() */ /*------------------------------------------------------------------------- - * Function: H5D_scatgath_write + * Function: H5D__scatgath_write * * Purpose: Perform scatter/gather write to a contiguous [piece of a] dataset. * @@ -586,7 +586,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { const H5D_dxpl_cache_t *dxpl_cache = io_info->dxpl_cache; /* Local pointer to dataset transfer info */ @@ -601,7 +601,7 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf size_t smine_nelmts; /*elements per strip */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(io_info); @@ -638,7 +638,7 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * buffer. Also gather data from the file into the background buffer * if necessary. */ - n = H5D_gather_mem(buf, mem_space, &mem_iter, smine_nelmts, + n = H5D__gather_mem(buf, mem_space, &mem_iter, smine_nelmts, dxpl_cache, type_info->tconv_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "mem gather failed") @@ -650,13 +650,13 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf * function H5T_conv_struct_opt to protect the background data. */ if(type_info->cmpd_subset && H5T_SUBSET_DST == type_info->cmpd_subset->subset - && type_info->dst_type_size == type_info->cmpd_subset->copy_size) { - if(H5D_compound_opt_write(smine_nelmts, type_info) < 0) + && type_info->dst_type_size == type_info->cmpd_subset->copy_size) { + if(H5D__compound_opt_write(smine_nelmts, type_info) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "datatype conversion failed") } /* end if */ else { if(H5T_BKG_YES == type_info->need_bkg) { - n = H5D_gather_file(io_info, file_space, &bkg_iter, smine_nelmts, + n = H5D__gather_file(io_info, file_space, &bkg_iter, smine_nelmts, type_info->bkg_buf/*out*/); if(n != smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") @@ -680,7 +680,7 @@ H5D_scatgath_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_inf /* * Scatter the data out to the file. */ - if(H5D_scatter_file(io_info, file_space, &file_iter, smine_nelmts, + if(H5D__scatter_file(io_info, file_space, &file_iter, smine_nelmts, type_info->tconv_buf) < 0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "scatter failed") } /* end for */ @@ -701,11 +701,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_scatgath_write() */ +} /* end H5D__scatgath_write() */ /*------------------------------------------------------------------------- - * Function: H5D_compound_opt_read + * Function: H5D__compound_opt_read * * Purpose: A special optimization case when the source and * destination members are a subset of each other, and @@ -737,7 +737,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_compound_opt_read(size_t nelmts, const H5S_t *space, +H5D__compound_opt_read(size_t nelmts, const H5S_t *space, H5S_sel_iter_t *iter, const H5D_dxpl_cache_t *dxpl_cache, const H5D_type_info_t *type_info, void *user_buf/*out*/) { @@ -750,7 +750,7 @@ H5D_compound_opt_read(size_t nelmts, const H5S_t *space, size_t src_stride, dst_stride, copy_size; herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_STATIC /* Check args */ HDassert(nelmts > 0); @@ -832,11 +832,11 @@ done: off = H5FL_SEQ_FREE(hsize_t, off); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_compound_opt_read() */ +} /* end H5D__compound_opt_read() */ /*------------------------------------------------------------------------- - * Function: H5D_compound_opt_write + * Function: H5D__compound_opt_write * * Purpose: A special optimization case when the source and * destination members are a subset of each other, and @@ -869,13 +869,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) +H5D__compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) { uint8_t *xsbuf, *xdbuf; /* Source & destination pointers into dataset buffer */ size_t src_stride, dst_stride; /* Strides through source & destination datatypes */ size_t i; /* Local index variable */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_STATIC_NOERR /* Check args */ HDassert(nelmts > 0); @@ -897,5 +897,5 @@ H5D_compound_opt_write(size_t nelmts, const H5D_type_info_t *type_info) } /* end for */ FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5D_compound_opt_write() */ +} /* end H5D__compound_opt_write() */ diff --git a/src/H5Dselect.c b/src/H5Dselect.c index d75b7ed..38f8bc4 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -49,6 +49,9 @@ /* Local Prototypes */ /********************/ +static herr_t H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, + size_t nelmts, const H5S_t *file_space, const H5S_t *mem_space); + /*********************/ /* Package Variables */ @@ -68,7 +71,7 @@ H5FL_SEQ_DEFINE(hsize_t); /*------------------------------------------------------------------------- - * Function: H5D_select_io + * Function: H5D__select_io * * Purpose: Perform I/O directly from application memory and a file * @@ -80,7 +83,7 @@ H5FL_SEQ_DEFINE(hsize_t); *------------------------------------------------------------------------- */ static herr_t -H5D_select_io(const H5D_io_info_t *io_info, size_t elmt_size, +H5D__select_io(const H5D_io_info_t *io_info, size_t elmt_size, size_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { H5S_sel_iter_t mem_iter; /* Memory selection iteration info */ @@ -102,7 +105,7 @@ H5D_select_io(const H5D_io_info_t *io_info, size_t elmt_size, ssize_t tmp_file_len; /* Temporary number of bytes in file sequence */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_STATIC /* Check args */ HDassert(io_info); @@ -245,11 +248,11 @@ done: mem_off = H5FL_SEQ_FREE(hsize_t, mem_off); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_select_io() */ +} /* end H5D__select_io() */ /*------------------------------------------------------------------------- - * Function: H5D_select_read + * Function: H5D__select_read * * Purpose: Reads directly from file into application memory. * @@ -261,26 +264,26 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__select_read(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Call generic selection operation */ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); - if(H5D_select_io(io_info, type_info->src_type_size, (size_t)nelmts, + if(H5D__select_io(io_info, type_info->src_type_size, (size_t)nelmts, file_space, mem_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_READERROR, FAIL, "read error") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_select_read() */ +} /* end H5D__select_read() */ /*------------------------------------------------------------------------- - * Function: H5D_select_write + * Function: H5D__select_write * * Purpose: Writes directly from application memory into a file * @@ -292,20 +295,20 @@ done: *------------------------------------------------------------------------- */ herr_t -H5D_select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, +H5D__select_write(const H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t nelmts, const H5S_t *file_space, const H5S_t *mem_space) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Call generic selection operation */ H5_CHECK_OVERFLOW(nelmts, hsize_t, size_t); - if(H5D_select_io(io_info, type_info->dst_type_size, (size_t)nelmts, + if(H5D__select_io(io_info, type_info->dst_type_size, (size_t)nelmts, file_space, mem_space) < 0) HGOTO_ERROR(H5E_DATASPACE, H5E_WRITEERROR, FAIL, "write error") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5D_select_write() */ +} /* end H5D__select_write() */ diff --git a/src/H5Dtest.c b/src/H5Dtest.c index c060db3..eef3c91 100644 --- a/src/H5Dtest.c +++ b/src/H5Dtest.c @@ -64,11 +64,11 @@ /*-------------------------------------------------------------------------- NAME - H5D_layout_version_test + H5D__layout_version_test PURPOSE Determine the storage layout version for a dataset's layout information USAGE - herr_t H5D_layout_version_test(did, version) + herr_t H5D__layout_version_test(did, version) hid_t did; IN: Dataset to query unsigned *version; OUT: Pointer to location to place version info RETURNS @@ -82,12 +82,12 @@ REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5D_layout_version_test(hid_t did, unsigned *version) +H5D__layout_version_test(hid_t did, unsigned *version) { H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -98,16 +98,16 @@ H5D_layout_version_test(hid_t did, unsigned *version) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_layout_version_test() */ +} /* H5D__layout_version_test() */ /*-------------------------------------------------------------------------- NAME - H5D_layout_contig_size_test + H5D__layout_contig_size_test PURPOSE Determine the size of a contiguous layout for a dataset's layout information USAGE - herr_t H5D_layout_contig_size_test(did, size) + herr_t H5D__layout_contig_size_test(did, size) hid_t did; IN: Dataset to query hsize_t *size; OUT: Pointer to location to place size info RETURNS @@ -121,12 +121,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5D_layout_contig_size_test(hid_t did, hsize_t *size) +H5D__layout_contig_size_test(hid_t did, hsize_t *size) { H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -139,16 +139,16 @@ H5D_layout_contig_size_test(hid_t did, hsize_t *size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_layout_contig_size_test() */ +} /* H5D__layout_contig_size_test() */ /*-------------------------------------------------------------------------- NAME - H5D_current_cache_size_test + H5D__current_cache_size_test PURPOSE Determine current the size of the dataset's chunk cache USAGE - herr_t H5D_current_cache_size_test(did, size) + herr_t H5D__current_cache_size_test(did, size) hid_t did; IN: Dataset to query hsize_t *size; OUT: Pointer to location to place size info RETURNS @@ -162,12 +162,12 @@ done: REVISION LOG --------------------------------------------------------------------------*/ herr_t -H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) +H5D__current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) { H5D_t *dset; /* Pointer to dataset to query */ herr_t ret_value = SUCCEED; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ if(NULL == (dset = (H5D_t *)H5I_object_verify(did, H5I_DATASET))) @@ -185,5 +185,5 @@ H5D_current_cache_size_test(hid_t did, size_t *nbytes_used, int *nused) done: FUNC_LEAVE_NOAPI(ret_value) -} /* H5D_current_cache_size_test() */ +} /* H5D__current_cache_size_test() */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index 1b602c7..6158fd9 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -84,7 +84,7 @@ static herr_t H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, #define H5O_DTYPE_CHECK_VERSION(DT, VERS, MIN_VERS, IOF, CLASS, ERR) \ if(((VERS) < (MIN_VERS)) && !(*(IOF) & H5O_DECODEIO_NOCHANGE)) { \ (VERS) = (MIN_VERS); \ - if(H5T_upgrade_version((DT), (VERS)) < 0) \ + if(H5T__upgrade_version((DT), (VERS)) < 0) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade " CLASS " encoding version") \ *(IOF) |= H5O_DECODEIO_DIRTY; \ } /* end if */ @@ -325,7 +325,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p } /* end if */ /* Allocate space for the field's datatype */ - if(NULL == (temp_type = H5T_alloc())) + if(NULL == (temp_type = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") /* Decode the field's datatype information */ @@ -349,7 +349,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p /* Check if this member is an array field */ if(ndims > 0) { /* Create the array datatype for the field */ - if((array_dt = H5T_array_create(temp_type, ndims, dim)) == NULL) { + if((array_dt = H5T__array_create(temp_type, ndims, dim)) == NULL) { for(j = 0; j <= i; j++) H5MM_xfree(dt->shared->u.compnd.memb[j].name); H5MM_xfree(dt->shared->u.compnd.memb); @@ -409,12 +409,12 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p } /* end for */ /* Check if the compound type is packed */ - H5T_update_packed(dt); + H5T__update_packed(dt); /* Upgrade the compound if requested */ if(version < upgrade_to) { version = upgrade_to; - if(H5T_upgrade_version(dt, upgrade_to) < 0) + if(H5T__upgrade_version(dt, upgrade_to) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade compound encoding version") /* We won't mark the message dirty since there were no * errors in the file, simply type versions that we will no @@ -453,7 +453,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p * Enumeration datatypes... */ dt->shared->u.enumer.nmembs = dt->shared->u.enumer.nalloc = flags & 0xffff; - if(NULL == (dt->shared->parent = H5T_alloc())) + if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") if(H5O_dtype_decode_helper(f, ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode parent datatype") @@ -495,7 +495,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p } /* end if */ /* Decode base type of VL information */ - if(NULL == (dt->shared->parent = H5T_alloc())) + if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") if(H5O_dtype_decode_helper(f, ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode VL parent type") @@ -535,7 +535,7 @@ H5O_dtype_decode_helper(H5F_t *f, unsigned *ioflags/*in,out*/, const uint8_t **p *pp += dt->shared->u.array.ndims * 4; /* Decode base type of array */ - if(NULL == (dt->shared->parent = H5T_alloc())) + if(NULL == (dt->shared->parent = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, "memory allocation failed") if(H5O_dtype_decode_helper(f, ioflags, pp, dt->shared->parent) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "unable to decode array parent type") @@ -1097,7 +1097,7 @@ H5O_dtype_decode(H5F_t *f, hid_t UNUSED dxpl_id, H5O_t UNUSED *open_oh, unsigned HDassert(p); /* Allocate datatype message */ - if(NULL == (dt = H5T_alloc())) + if(NULL == (dt = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Perform actual decode of message */ @@ -1358,7 +1358,7 @@ H5O_dtype_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOERR if(dt) - H5T_free(dt); + H5T__free(dt); FUNC_LEAVE_NOAPI(SUCCEED) } /* end H5O_dtype_reset() */ diff --git a/src/H5Olayout.c b/src/H5Olayout.c index e912d8c..6326fd9 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -445,7 +445,7 @@ H5O_layout_size(const H5F_t *f, hbool_t UNUSED disable_shared, const void *_mesg /* Compute serialized size */ /* (including possibly compact data) */ - ret_value = H5D_layout_meta_size(f, mesg, TRUE); + ret_value = H5D__layout_meta_size(f, mesg, TRUE); FUNC_LEAVE_NOAPI(ret_value) } /* end H5O_layout_size() */ @@ -550,13 +550,13 @@ H5O_layout_delete(H5F_t *f, hid_t dxpl_id, H5O_t *open_oh, void *_mesg) case H5D_CONTIGUOUS: /* Contiguous block on disk */ /* Free the file space for the raw data */ - if(H5D_contig_delete(f, dxpl_id, &mesg->storage) < 0) + if(H5D__contig_delete(f, dxpl_id, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; case H5D_CHUNKED: /* Chunked blocks on disk */ /* Free the file space for the index & chunk raw data */ - if(H5D_chunk_delete(f, dxpl_id, open_oh, &mesg->storage) < 0) + if(H5D__chunk_delete(f, dxpl_id, open_oh, &mesg->storage) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free raw data") break; @@ -615,7 +615,7 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, case H5D_COMPACT: if(layout_src->storage.u.compact.buf) { /* copy compact raw data */ - if(H5D_compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__compact_copy(file_src, &layout_src->storage.u.compact, file_dst, &layout_dst->storage.u.compact, udata->src_dtype, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ @@ -630,18 +630,18 @@ H5O_layout_copy_file(H5F_t *file_src, void *mesg_src, H5F_t *file_dst, layout_dst->storage.u.contig.size = H5S_extent_nelem(udata->src_space_extent) * H5T_get_size(udata->src_dtype); - if(H5D_contig_is_space_alloc(&layout_src->storage)) { + if(H5D__contig_is_space_alloc(&layout_src->storage)) { /* copy contiguous raw data */ - if(H5D_contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) + if(H5D__contig_copy(file_src, &layout_src->storage.u.contig, file_dst, &layout_dst->storage.u.contig, udata->src_dtype, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy contiguous storage") copied = TRUE; } /* end if */ break; case H5D_CHUNKED: - if(H5D_chunk_is_space_alloc(&layout_src->storage)) { + if(H5D__chunk_is_space_alloc(&layout_src->storage)) { /* Create chunked layout */ - if(H5D_chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info, dxpl_id) < 0) + if(H5D__chunk_copy(file_src, &layout_src->storage.u.chunk, &layout_src->u.chunk, file_dst, &layout_dst->storage.u.chunk, udata->src_space_extent, udata->src_dtype, udata->common.src_pline, cpy_info, dxpl_id) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy chunked storage") copied = TRUE; } /* end if */ diff --git a/src/H5T.c b/src/H5T.c index 37d4b68..73a1470 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -275,6 +275,7 @@ static herr_t H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, static htri_t H5T_compiler_conv(H5T_t *src, H5T_t *dst); static herr_t H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc); static H5T_t *H5T_decode(const unsigned char *buf); +static herr_t H5T_set_size(H5T_t *dt, size_t size); /* Local macro definitions */ #define H5T_ENCODE_VERSION 0 @@ -478,7 +479,7 @@ static H5T_t *H5T_decode(const unsigned char *buf); #define H5T_INIT_TYPE_ALLOC_CREATE(BASE) { \ /* Allocate new datatype info */ \ - if(NULL == (dt = H5T_alloc())) \ + if(NULL == (dt = H5T__alloc())) \ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, FAIL, "memory allocation failed") \ } @@ -569,9 +570,9 @@ H5T_init_inf(void) /* +Inf */ d = (uint8_t *)&H5T_NATIVE_FLOAT_POS_INF_g; - H5T_bit_set(d, dst->u.f.sign, (size_t)1, FALSE); - H5T_bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T_bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); /* Swap the bytes if the machine architecture is big-endian */ if (H5T_ORDER_BE == H5T_native_order_g) { @@ -585,9 +586,9 @@ H5T_init_inf(void) /* -Inf */ d = (uint8_t *)&H5T_NATIVE_FLOAT_NEG_INF_g; - H5T_bit_set(d, dst->u.f.sign, (size_t)1, TRUE); - H5T_bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T_bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); /* Swap the bytes if the machine architecture is big-endian */ if(H5T_ORDER_BE == H5T_native_order_g) { @@ -610,9 +611,9 @@ H5T_init_inf(void) /* +Inf */ d = (uint8_t *)&H5T_NATIVE_DOUBLE_POS_INF_g; - H5T_bit_set(d, dst->u.f.sign, (size_t)1, FALSE); - H5T_bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T_bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, FALSE); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); /* Swap the bytes if the machine architecture is big-endian */ if(H5T_ORDER_BE == H5T_native_order_g) { @@ -626,9 +627,9 @@ H5T_init_inf(void) /* -Inf */ d = (uint8_t *)&H5T_NATIVE_DOUBLE_NEG_INF_g; - H5T_bit_set(d, dst->u.f.sign, (size_t)1, TRUE); - H5T_bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); - H5T_bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); + H5T__bit_set(d, dst->u.f.sign, (size_t)1, TRUE); + H5T__bit_set(d, dst->u.f.epos, dst->u.f.esize, TRUE); + H5T__bit_set(d, dst->u.f.mpos, dst->u.f.msize, FALSE); /* Swap the bytes if the machine architecture is big-endian */ if(H5T_ORDER_BE == H5T_native_order_g) { @@ -1002,32 +1003,32 @@ H5T_init_interface(void) */ fixedpt = native_int; floatpt = native_float; - if (NULL == (compound = H5T_create(H5T_COMPOUND, (size_t)1))) + if (NULL == (compound = H5T__create(H5T_COMPOUND, (size_t)1))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if (NULL == (enum_type = H5T_create(H5T_ENUM, (size_t)1))) + if (NULL == (enum_type = H5T__create(H5T_ENUM, (size_t)1))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if (NULL == (vlen = H5T_vlen_create(native_int))) + if (NULL == (vlen = H5T__vlen_create(native_int))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") - if (NULL == (array = H5T_array_create(native_int, 1, dim))) + if (NULL == (array = H5T__array_create(native_int, 1, dim))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") status = 0; - status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T_conv_i_i, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T_conv_i_f, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T_conv_f_f, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T_conv_f_i, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T_conv_s_s, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T_conv_b_b, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T_conv_order, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T_conv_order_opt, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T_conv_order, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T_conv_order_opt, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T_conv_struct, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T_conv_struct_opt, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T_conv_enum, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T_conv_vlen, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T_conv_array, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T_conv_order_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "i_i", fixedpt, fixedpt, H5T__conv_i_i, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "i_f", fixedpt, floatpt, H5T__conv_i_f, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "f_f", floatpt, floatpt, H5T__conv_f_f, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "f_i", floatpt, fixedpt, H5T__conv_f_i, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "s_s", string, string, H5T__conv_s_s, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "b_b", bitfield, bitfield, H5T__conv_b_b, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "ibo", fixedpt, fixedpt, H5T__conv_order, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "ibo(opt)", fixedpt, fixedpt, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "fbo", floatpt, floatpt, H5T__conv_order, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "fbo(opt)", floatpt, floatpt, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "struct(no-opt)", compound, compound, H5T__conv_struct, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "struct(opt)", compound, compound, H5T__conv_struct_opt, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "enum", enum_type, enum_type, H5T__conv_enum, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "vlen", vlen, vlen, H5T__conv_vlen, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "array", array, array, H5T__conv_array, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_SOFT, "objref", objref, objref, H5T__conv_order_opt, H5AC_dxpl_id, FALSE); /* * Native conversions should be listed last since we can use hardware to @@ -1039,263 +1040,263 @@ H5T_init_interface(void) /* floating point */ #if H5T_CONV_INTERNAL_FP_FP - status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T_conv_float_double, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T_conv_double_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_dbl", native_float, native_double, H5T__conv_float_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_flt", native_double, native_float, H5T__conv_double_float, H5AC_dxpl_id, FALSE); #endif /*H5T_CONV_INTERNAL_FP_FP*/ #if H5T_CONV_INTERNAL_FP_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T_conv_float_ldouble, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T_conv_double_ldouble, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T_conv_ldouble_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T_conv_ldouble_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ldbl", native_float, native_ldouble, H5T__conv_float_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ldbl", native_double, native_ldouble, H5T__conv_double_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_flt", native_ldouble, native_float, H5T__conv_ldouble_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_dbl", native_ldouble, native_double, H5T__conv_ldouble_double, H5AC_dxpl_id, FALSE); #endif /*H5T_CONV_INTERNAL_FP_LDOUBLE*/ /* from long long */ - status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T_conv_llong_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T_conv_ullong_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T_conv_llong_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T_conv_llong_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T_conv_ullong_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T_conv_ullong_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T_conv_llong_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T_conv_llong_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T_conv_ullong_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T_conv_ullong_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T_conv_llong_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T_conv_llong_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T_conv_ullong_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T_conv_ullong_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T_conv_llong_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T_conv_llong_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T_conv_ullong_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T_conv_ullong_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ullong", native_llong, native_ullong, H5T__conv_llong_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_llong", native_ullong, native_llong, H5T__conv_ullong_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_long", native_llong, native_long, H5T__conv_llong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ulong", native_llong, native_ulong, H5T__conv_llong_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_long", native_ullong, native_long, H5T__conv_ullong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ulong", native_ullong, native_ulong, H5T__conv_ullong_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_short", native_llong, native_short, H5T__conv_llong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ushort", native_llong, native_ushort, H5T__conv_llong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_short", native_ullong, native_short, H5T__conv_ullong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ushort", native_ullong, native_ushort, H5T__conv_ullong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_int", native_llong, native_int, H5T__conv_llong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_uint", native_llong, native_uint, H5T__conv_llong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_int", native_ullong, native_int, H5T__conv_ullong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_uint", native_ullong, native_uint, H5T__conv_ullong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_schar", native_llong, native_schar, H5T__conv_llong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_uchar", native_llong, native_uchar, H5T__conv_llong_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_schar", native_ullong, native_schar, H5T__conv_ullong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_uchar", native_ullong, native_uchar, H5T__conv_ullong_uchar, H5AC_dxpl_id, FALSE); /* From long */ - status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T_conv_long_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T_conv_long_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T_conv_ulong_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T_conv_ulong_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T_conv_long_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T_conv_ulong_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T_conv_long_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T_conv_long_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T_conv_ulong_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T_conv_ulong_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T_conv_long_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T_conv_long_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T_conv_ulong_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T_conv_ulong_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T_conv_long_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T_conv_long_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T_conv_ulong_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T_conv_ulong_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_llong", native_long, native_llong, H5T__conv_long_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ullong", native_long, native_ullong, H5T__conv_long_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_llong", native_ulong, native_llong, H5T__conv_ulong_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ullong", native_ulong, native_ullong, H5T__conv_ulong_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ulong", native_long, native_ulong, H5T__conv_long_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_long", native_ulong, native_long, H5T__conv_ulong_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_short", native_long, native_short, H5T__conv_long_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ushort", native_long, native_ushort, H5T__conv_long_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_short", native_ulong, native_short, H5T__conv_ulong_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ushort", native_ulong, native_ushort, H5T__conv_ulong_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_int", native_long, native_int, H5T__conv_long_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_uint", native_long, native_uint, H5T__conv_long_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_int", native_ulong, native_int, H5T__conv_ulong_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_uint", native_ulong, native_uint, H5T__conv_ulong_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_schar", native_long, native_schar, H5T__conv_long_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_uchar", native_long, native_uchar, H5T__conv_long_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_schar", native_ulong, native_schar, H5T__conv_ulong_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_uchar", native_ulong, native_uchar, H5T__conv_ulong_uchar, H5AC_dxpl_id, FALSE); /* From short */ - status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T_conv_short_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T_conv_short_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T_conv_ushort_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T_conv_ushort_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T_conv_short_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T_conv_short_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T_conv_ushort_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T_conv_ushort_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T_conv_short_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T_conv_ushort_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T_conv_short_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T_conv_short_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T_conv_ushort_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T_conv_ushort_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T_conv_short_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T_conv_short_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T_conv_ushort_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T_conv_ushort_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_llong", native_short, native_llong, H5T__conv_short_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ullong", native_short, native_ullong, H5T__conv_short_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_llong", native_ushort, native_llong, H5T__conv_ushort_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ullong", native_ushort, native_ullong, H5T__conv_ushort_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_long", native_short, native_long, H5T__conv_short_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ulong", native_short, native_ulong, H5T__conv_short_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_long", native_ushort, native_long, H5T__conv_ushort_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ulong", native_ushort, native_ulong, H5T__conv_ushort_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ushort", native_short, native_ushort, H5T__conv_short_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_short", native_ushort, native_short, H5T__conv_ushort_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_int", native_short, native_int, H5T__conv_short_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_uint", native_short, native_uint, H5T__conv_short_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_int", native_ushort, native_int, H5T__conv_ushort_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_uint", native_ushort, native_uint, H5T__conv_ushort_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_schar", native_short, native_schar, H5T__conv_short_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_uchar", native_short, native_uchar, H5T__conv_short_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_schar", native_ushort, native_schar, H5T__conv_ushort_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_uchar", native_ushort, native_uchar, H5T__conv_ushort_uchar, H5AC_dxpl_id, FALSE); /* From int */ - status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T_conv_int_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T_conv_int_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T_conv_uint_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T_conv_uint_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T_conv_int_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T_conv_int_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T_conv_uint_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T_conv_uint_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T_conv_int_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T_conv_int_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T_conv_uint_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T_conv_uint_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T_conv_int_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T_conv_uint_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T_conv_int_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T_conv_int_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T_conv_uint_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T_conv_uint_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_llong", native_int, native_llong, H5T__conv_int_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ullong", native_int, native_ullong, H5T__conv_int_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_llong", native_uint, native_llong, H5T__conv_uint_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ullong", native_uint, native_ullong, H5T__conv_uint_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_long", native_int, native_long, H5T__conv_int_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ulong", native_int, native_ulong, H5T__conv_int_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_long", native_uint, native_long, H5T__conv_uint_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ulong", native_uint, native_ulong, H5T__conv_uint_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_short", native_int, native_short, H5T__conv_int_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ushort", native_int, native_ushort, H5T__conv_int_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_short", native_uint, native_short, H5T__conv_uint_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ushort", native_uint, native_ushort, H5T__conv_uint_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_uint", native_int, native_uint, H5T__conv_int_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_int", native_uint, native_int, H5T__conv_uint_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_schar", native_int, native_schar, H5T__conv_int_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_uchar", native_int, native_uchar, H5T__conv_int_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_schar", native_uint, native_schar, H5T__conv_uint_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_uchar", native_uint, native_uchar, H5T__conv_uint_uchar, H5AC_dxpl_id, FALSE); /* From char */ - status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T_conv_schar_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T_conv_schar_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T_conv_uchar_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T_conv_uchar_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T_conv_schar_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T_conv_schar_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T_conv_uchar_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T_conv_uchar_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T_conv_schar_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T_conv_schar_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T_conv_uchar_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T_conv_uchar_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T_conv_schar_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T_conv_schar_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T_conv_uchar_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T_conv_uchar_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T_conv_schar_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T_conv_uchar_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_llong", native_schar, native_llong, H5T__conv_schar_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ullong", native_schar, native_ullong, H5T__conv_schar_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_llong", native_uchar, native_llong, H5T__conv_uchar_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ullong", native_uchar, native_ullong, H5T__conv_uchar_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_long", native_schar, native_long, H5T__conv_schar_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ulong", native_schar, native_ulong, H5T__conv_schar_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_long", native_uchar, native_long, H5T__conv_uchar_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ulong", native_uchar, native_ulong, H5T__conv_uchar_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_short", native_schar, native_short, H5T__conv_schar_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ushort", native_schar, native_ushort, H5T__conv_schar_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_short", native_uchar, native_short, H5T__conv_uchar_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ushort", native_uchar, native_ushort, H5T__conv_uchar_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_int", native_schar, native_int, H5T__conv_schar_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_uint", native_schar, native_uint, H5T__conv_schar_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_int", native_uchar, native_int, H5T__conv_uchar_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_uint", native_uchar, native_uint, H5T__conv_uchar_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_uchar", native_schar, native_uchar, H5T__conv_schar_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_schar", native_uchar, native_schar, H5T__conv_uchar_schar, H5AC_dxpl_id, FALSE); /* From char to floats */ - status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T_conv_schar_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T_conv_schar_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_flt", native_schar, native_float, H5T__conv_schar_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_dbl", native_schar, native_double, H5T__conv_schar_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T_conv_schar_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "schar_ldbl", native_schar, native_ldouble, H5T__conv_schar_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From unsigned char to floats */ - status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T_conv_uchar_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T_conv_uchar_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_flt", native_uchar, native_float, H5T__conv_uchar_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_dbl", native_uchar, native_double, H5T__conv_uchar_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T_conv_uchar_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uchar_ldbl", native_uchar, native_ldouble, H5T__conv_uchar_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From short to floats */ - status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T_conv_short_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T_conv_short_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_flt", native_short, native_float, H5T__conv_short_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_dbl", native_short, native_double, H5T__conv_short_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T_conv_short_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "short_ldbl", native_short, native_ldouble, H5T__conv_short_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From unsigned short to floats */ - status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T_conv_ushort_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T_conv_ushort_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_flt", native_ushort, native_float, H5T__conv_ushort_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_dbl", native_ushort, native_double, H5T__conv_ushort_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T_conv_ushort_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ushort_ldbl", native_ushort, native_ldouble, H5T__conv_ushort_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From int to floats */ - status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T_conv_int_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T_conv_int_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_flt", native_int, native_float, H5T__conv_int_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_dbl", native_int, native_double, H5T__conv_int_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T_conv_int_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "int_ldbl", native_int, native_ldouble, H5T__conv_int_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From unsigned int to floats */ - status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T_conv_uint_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T_conv_uint_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_flt", native_uint, native_float, H5T__conv_uint_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_dbl", native_uint, native_double, H5T__conv_uint_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T_conv_uint_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "uint_ldbl", native_uint, native_ldouble, H5T__conv_uint_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From long to floats */ - status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T_conv_long_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T_conv_long_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_flt", native_long, native_float, H5T__conv_long_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_dbl", native_long, native_double, H5T__conv_long_double, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T_conv_long_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "long_ldbl", native_long, native_ldouble, H5T__conv_long_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_INTEGER_LDOUBLE */ /* From unsigned long to floats */ #if H5T_CONV_INTERNAL_ULONG_FLT - status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T_conv_ulong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_flt", native_ulong, native_float, H5T__conv_ulong_float, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULONG_FLT */ #if H5T_CONV_INTERNAL_ULONG_DBL - status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T_conv_ulong_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_dbl", native_ulong, native_double, H5T__conv_ulong_double, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULONG_DBL */ #if H5T_CONV_INTERNAL_ULONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T_conv_ulong_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ulong_ldbl", native_ulong, native_ldouble, H5T__conv_ulong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULONG_LDOUBLE */ /* From long long to floats */ - status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T_conv_llong_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T_conv_llong_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_flt", native_llong, native_float, H5T__conv_llong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_dbl", native_llong, native_double, H5T__conv_llong_double, H5AC_dxpl_id, FALSE); #ifdef H5T_CONV_INTERNAL_LLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T_conv_llong_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "llong_ldbl", native_llong, native_ldouble, H5T__conv_llong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LLONG_LDOUBLE */ /* From unsigned long long to floats */ #if H5T_CONV_INTERNAL_ULLONG_FP - status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T_conv_ullong_float, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T_conv_ullong_double, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_flt", native_ullong, native_float, H5T__conv_ullong_float, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_dbl", native_ullong, native_double, H5T__conv_ullong_double, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULLONG_FP */ #ifdef H5T_CONV_INTERNAL_ULLONG_LDOUBLE - status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T_conv_ullong_ldouble, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ullong_ldbl", native_ullong, native_ldouble, H5T__conv_ullong_ldouble, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_ULLONG_LDOUBLE */ /* From floats to char */ - status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T_conv_float_schar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T_conv_double_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_schar", native_float, native_schar, H5T__conv_float_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_schar", native_double, native_schar, H5T__conv_double_schar, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T_conv_ldouble_schar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_schar", native_ldouble, native_schar, H5T__conv_ldouble_schar, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to unsigned char */ - status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T_conv_float_uchar, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T_conv_double_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_uchar", native_float, native_uchar, H5T__conv_float_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_uchar", native_double, native_uchar, H5T__conv_double_uchar, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T_conv_ldouble_uchar, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_uchar", native_ldouble, native_uchar, H5T__conv_ldouble_uchar, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to short */ - status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T_conv_float_short, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T_conv_double_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_short", native_float, native_short, H5T__conv_float_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_short", native_double, native_short, H5T__conv_double_short, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T_conv_ldouble_short, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_short", native_ldouble, native_short, H5T__conv_ldouble_short, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to unsigned short */ - status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T_conv_float_ushort, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T_conv_double_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ushort", native_float, native_ushort, H5T__conv_float_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ushort", native_double, native_ushort, H5T__conv_double_ushort, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T_conv_ldouble_ushort, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ushort", native_ldouble, native_ushort, H5T__conv_ldouble_ushort, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to int */ - status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T_conv_float_int, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T_conv_double_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_int", native_float, native_int, H5T__conv_float_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_int", native_double, native_int, H5T__conv_double_int, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T_conv_ldouble_int, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_int", native_ldouble, native_int, H5T__conv_ldouble_int, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to unsigned int */ - status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T_conv_float_uint, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T_conv_double_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_uint", native_float, native_uint, H5T__conv_float_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_uint", native_double, native_uint, H5T__conv_double_uint, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_UINT - status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T_conv_ldouble_uint, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_uint", native_ldouble, native_uint, H5T__conv_ldouble_uint, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_UINT */ - status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T_conv_float_long, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T_conv_double_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_long", native_float, native_long, H5T__conv_float_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_long", native_double, native_long, H5T__conv_double_long, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T_conv_ldouble_long, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_long", native_ldouble, native_long, H5T__conv_ldouble_long, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to unsigned long */ - status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T_conv_float_ulong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T_conv_double_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ulong", native_float, native_ulong, H5T__conv_float_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ulong", native_double, native_ulong, H5T__conv_double_ulong, H5AC_dxpl_id, FALSE); #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER - status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T_conv_ldouble_ulong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ulong", native_ldouble, native_ulong, H5T__conv_ldouble_ulong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ /* From floats to long long */ #if H5T_CONV_INTERNAL_FP_LLONG - status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T_conv_float_llong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T_conv_double_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_llong", native_float, native_llong, H5T__conv_float_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_llong", native_double, native_llong, H5T__conv_double_llong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_FP_LLONG */ #ifdef H5T_CONV_INTERNAL_LDOUBLE_LLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T_conv_ldouble_llong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_llong", native_ldouble, native_llong, H5T__conv_ldouble_llong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_LLONG */ /* From floats to unsigned long long */ #if H5T_CONV_INTERNAL_FP_ULLONG - status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T_conv_float_ullong, H5AC_dxpl_id, FALSE); - status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T_conv_double_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "flt_ullong", native_float, native_ullong, H5T__conv_float_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "dbl_ullong", native_double, native_ullong, H5T__conv_double_ullong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_FP_ULLONG */ #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG - status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T_conv_ldouble_ullong, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "ldbl_ullong", native_ldouble, native_ullong, H5T__conv_ldouble_ullong, H5AC_dxpl_id, FALSE); #endif /* H5T_CONV_INTERNAL_LDOUBLE_ULLONG */ /* @@ -1303,7 +1304,7 @@ H5T_init_interface(void) * data types we use are not important as long as the source and * destination are equal. */ - status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T_conv_noop, H5AC_dxpl_id, FALSE); + status |= H5T_register(H5T_PERS_HARD, "no-op", native_int, native_int, H5T__conv_noop, H5AC_dxpl_id, FALSE); /* Initialize the +/- Infinity values for floating-point types */ status |= H5T_init_inf(); @@ -1416,7 +1417,7 @@ H5T_term_interface(void) path = H5T_g.path[i]; HDassert(path); if(path->func) { - H5T_print_stats(path, &nprint/*in,out*/); + H5T__print_stats(path, &nprint/*in,out*/); path->cdata.command = H5T_CONV_FREE; if((path->func)(FAIL, FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL,H5AC_dxpl_id) < 0) { @@ -1594,7 +1595,7 @@ H5Tcreate(H5T_class_t type, size_t size) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size must be positive") /* create the type */ - if(NULL == (dt = H5T_create(type, size))) + if(NULL == (dt = H5T__create(type, size))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create type") /* Get an ID for the datatype */ @@ -2371,7 +2372,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, new_path = NULL; /*so we don't free it on error*/ /* Free old path */ - H5T_print_stats(old_path, &nprint); + H5T__print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { @@ -2543,7 +2544,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, --H5T_g.npaths; /* Shut down path */ - H5T_print_stats(path, &nprint); + H5T__print_stats(path, &nprint); path->cdata.command = H5T_CONV_FREE; if((path->func)(FAIL, FAIL, &(path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { @@ -2955,7 +2956,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_create + * Function: H5T__create * * Purpose: Creates a new data type and initializes it to reasonable * values. The new data type is SIZE bytes and an instance of @@ -2975,12 +2976,12 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_create(H5T_class_t type, size_t size) +H5T__create(H5T_class_t type, size_t size) { H5T_t *dt = NULL; H5T_t *ret_value = NULL; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE switch(type) { case H5T_INTEGER: @@ -3008,7 +3009,7 @@ H5T_create(H5T_class_t type, size_t size) case H5T_OPAQUE: case H5T_COMPOUND: - if(NULL == (dt = H5T_alloc())) + if(NULL == (dt = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") dt->shared->type = type; @@ -3039,7 +3040,7 @@ H5T_create(H5T_class_t type, size_t size) subtype = H5T_NATIVE_LLONG_g; else HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "no applicable native integer type") - if(NULL == (dt = H5T_alloc())) + if(NULL == (dt = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") dt->shared->type = type; if(NULL == (sub_t_obj = (H5T_t *)H5I_object(subtype))) @@ -3078,7 +3079,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_create() */ +} /* end H5T__create() */ /*------------------------------------------------------------------------- @@ -3420,7 +3421,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_alloc + * Function: H5T__alloc * * Purpose: Allocates a new H5T_t structure, initializing it correctly. * @@ -3432,12 +3433,12 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_alloc(void) +H5T__alloc(void) { H5T_t *dt = NULL; /* Pointer to datatype allocated */ H5T_t *ret_value; /* Return value */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE /* Allocate & initialize datatype wrapper info */ if(NULL == (dt = H5FL_CALLOC(H5T_t))) @@ -3463,11 +3464,11 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_alloc() */ +} /* end H5T__alloc() */ /*------------------------------------------------------------------------- - * Function: H5T_free + * Function: H5T__free * * Purpose: Frees all memory associated with a datatype, but does not * free the H5T_t or H5T_shared_t structures (which should @@ -3481,12 +3482,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_free(H5T_t *dt) +H5T__free(H5T_t *dt) { unsigned i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(dt && dt->shared); @@ -3550,7 +3551,7 @@ H5T_free(H5T_t *dt) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_free() */ +} /* end H5T__free() */ /*------------------------------------------------------------------------- @@ -3575,7 +3576,7 @@ done: * Added "ID to name" support * * Quincey Koziol, 2003-01-06 - * Moved "guts" of function to H5T_free() + * Moved "guts" of function to H5T__free() * *------------------------------------------------------------------------- */ @@ -3592,7 +3593,7 @@ H5T_close(H5T_t *dt) dt->shared->fo_count--; if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 0) { - if(H5T_free(dt) < 0) + if(H5T__free(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); dt->shared = H5FL_FREE(H5T_shared_t, dt->shared); @@ -3621,7 +3622,7 @@ H5T_close(H5T_t *dt) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, FAIL, "problem attempting to free location") } /* end if */ - /* Free the group hier. path since we're not calling H5T_free*/ + /* Free the group hier. path since we're not calling H5T__free*/ H5G_name_free(&(dt->path)); } /* end else */ @@ -3663,13 +3664,13 @@ done: * *------------------------------------------------------------------------- */ -herr_t +static herr_t H5T_set_size(H5T_t *dt, size_t size) { size_t prec, offset; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_NOAPI_NOINIT /* Check args */ assert(dt); @@ -3731,7 +3732,7 @@ H5T_set_size(H5T_t *dt, size_t size) } } - max_size = H5T_get_member_size(dt, max_index); + max_size = H5T__get_member_size(dt, max_index); if(size<(max_offset+max_size)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "size shrinking will cut off last member "); @@ -3821,7 +3822,7 @@ H5T_set_size(H5T_t *dt, size_t size) /* Check if the new compound type is packed */ if(dt->shared->type == H5T_COMPOUND) - H5T_update_packed(dt); + H5T__update_packed(dt); } done: @@ -4348,9 +4349,9 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, if(NULL == (H5T_g.path[0] = H5FL_CALLOC(H5T_path_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for no-op conversion path") HDstrcpy(H5T_g.path[0]->name, "no-op"); - H5T_g.path[0]->func = H5T_conv_noop; + H5T_g.path[0]->func = H5T__conv_noop; H5T_g.path[0]->cdata.command = H5T_CONV_INIT; - if(H5T_conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { + if(H5T__conv_noop(FAIL, FAIL, &(H5T_g.path[0]->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG if(H5DEBUG(T)) fprintf(H5DEBUG(T), "H5T: unable to initialize no-op conversion function (ignored)\n"); @@ -4506,7 +4507,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, /* Replace an existing table entry or add a new entry */ if(table && path != table) { HDassert(table == H5T_g.path[md]); - H5T_print_stats(table, &nprint/*in,out*/); + H5T__print_stats(table, &nprint/*in,out*/); table->cdata.command = H5T_CONV_FREE; if((table->func)(FAIL, FAIL, &(table->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id) < 0) { #ifdef H5T_DEBUG @@ -4635,7 +4636,7 @@ H5T_path_compound_subset(const H5T_path_t *p) HDassert(p); if(p->are_compounds) - ret_value = H5T_conv_struct_subset(&(p->cdata)); + ret_value = H5T__conv_struct_subset(&(p->cdata)); FUNC_LEAVE_NOAPI(ret_value) } /* end H5T_path_compound_subset */ @@ -5075,7 +5076,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ /* Sort the fields based on offsets */ - H5T_sort_value(dt,NULL); + H5T__sort_value(dt, NULL); for (i=0,accum_change=0; ishared->u.compnd.nmembs; i++) { H5T_t *memb_type; /* Member's datatype pointer */ @@ -5124,7 +5125,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) } /* end if */ /* Mark this VL sequence */ - if((changed=H5T_vlen_set_loc(dt,f,loc))<0) + if((changed = H5T__vlen_set_loc(dt, f, loc)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed>0) ret_value=changed; @@ -5196,7 +5197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_upgrade_version_cb * - * Purpose: H5T_visit callback to Upgrade the version of a datatype + * Purpose: H5T__visit callback to Upgrade the version of a datatype * (if there's any benefit to doing so) * * Note: The behavior below is tightly coupled with the "better" @@ -5243,7 +5244,7 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) /*------------------------------------------------------------------------- - * Function: H5T_upgrade_version + * Function: H5T__upgrade_version * * Purpose: Upgrade the version of a datatype (if there's any benefit to * doing so) and recursively apply to compound members and/or @@ -5257,22 +5258,22 @@ H5T_upgrade_version_cb(H5T_t *dt, void *op_value) *------------------------------------------------------------------------- */ herr_t -H5T_upgrade_version(H5T_t *dt, unsigned new_version) +H5T__upgrade_version(H5T_t *dt, unsigned new_version) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(dt); /* Iterate over entire datatype, upgrading the version of components, if it's useful */ - if(H5T_visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T_upgrade_version_cb, &new_version) < 0) + if(H5T__visit(dt, (H5T_VISIT_SIMPLE | H5T_VISIT_COMPLEX_LAST), H5T_upgrade_version_cb, &new_version) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "iteration to upgrade datatype encoding version failed") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_upgrade_version() */ +} /* end H5T__upgrade_version() */ /*------------------------------------------------------------------------- @@ -5298,7 +5299,7 @@ H5T_set_latest_version(H5T_t *dt) HDassert(dt); /* Upgrade the format version for the datatype to the latest */ - if(H5T_upgrade_version(dt, H5O_DTYPE_VERSION_LATEST) < 0) + if(H5T__upgrade_version(dt, H5O_DTYPE_VERSION_LATEST) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade datatype encoding") done: diff --git a/src/H5Tarray.c b/src/H5Tarray.c index 714ecc9..e9c8fe7 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -142,7 +142,7 @@ H5Tarray_create2(hid_t base_id, unsigned ndims, const hsize_t dim[/* ndims */]) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Create the array datatype */ - if(NULL == (dt = H5T_array_create(base, ndims, dim))) + if(NULL == (dt = H5T__array_create(base, ndims, dim))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") /* Atomize the type */ @@ -160,7 +160,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_array_create + * Function: H5T__array_create * * Purpose: Internal routine to create a new array data type based on the * specified BASE_TYPE. The type is an array with NDIMS dimensionality @@ -177,19 +177,19 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) +H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) { H5T_t *ret_value; /* new array data type */ unsigned u; /* local index variable */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE HDassert(base); HDassert(ndims <= H5S_MAX_RANK); HDassert(dim); /* Build new type */ - if(NULL == (ret_value = H5T_alloc())) + if(NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ret_value->shared->type = H5T_ARRAY; @@ -217,7 +217,7 @@ H5T_array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_array_create */ +} /* end H5T__array_create */ /*------------------------------------------------------------------------- @@ -249,7 +249,7 @@ H5Tget_array_ndims(hid_t type_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an array datatype") /* Retrieve the number of dimensions */ - ret_value = H5T_get_array_ndims(dt); + ret_value = H5T__get_array_ndims(dt); done: FUNC_LEAVE_API(ret_value) @@ -257,9 +257,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_array_ndims + * Function: H5T__get_array_ndims * - * Purpose: Private function for H5T_get_array_ndims. Query the number + * Purpose: Private function for H5T__get_array_ndims. Query the number * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array datatype @@ -271,16 +271,16 @@ done: *------------------------------------------------------------------------- */ int -H5T_get_array_ndims(const H5T_t *dt) +H5T__get_array_ndims(const H5T_t *dt) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(dt); HDassert(dt->shared->type == H5T_ARRAY); /* Retrieve the number of dimensions */ FUNC_LEAVE_NOAPI(dt->shared->u.array.ndims) -} /* end H5T_get_array_ndims */ +} /* end H5T__get_array_ndims */ /*------------------------------------------------------------------------- @@ -312,7 +312,7 @@ H5Tget_array_dims2(hid_t type_id, hsize_t dims[]) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an array datatype") /* Retrieve the sizes of the dimensions */ - if((ret_value = H5T_get_array_dims(dt, dims)) < 0) + if((ret_value = H5T__get_array_dims(dt, dims)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get dimension sizes") done: FUNC_LEAVE_API(ret_value) @@ -320,9 +320,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_array_dims + * Function: H5T__get_array_dims * - * Purpose: Private function for H5T_get_array_dims. Query the sizes + * Purpose: Private function for H5T__get_array_dims. Query the sizes * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array type @@ -334,12 +334,12 @@ done: *------------------------------------------------------------------------- */ int -H5T_get_array_dims(const H5T_t *dt, hsize_t dims[]) +H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]) { unsigned u; /* Local index variable */ int ret_value; /* return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE HDassert(dt); HDassert(dt->shared->type == H5T_ARRAY); @@ -354,7 +354,7 @@ H5T_get_array_dims(const H5T_t *dt, hsize_t dims[]) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_get_array_dims */ +} /* end H5T__get_array_dims */ #ifndef H5_NO_DEPRECATED_SYMBOLS @@ -401,7 +401,7 @@ H5Tarray_create1(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Create the array datatype */ - if(NULL == (dt = H5T_array_create(base, (unsigned)ndims, dim))) + if(NULL == (dt = H5T__array_create(base, (unsigned)ndims, dim))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to create datatype") /* Atomize the type */ @@ -447,7 +447,7 @@ H5Tget_array_dims1(hid_t type_id, hsize_t dims[], int UNUSED perm[]) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an array datatype") /* Retrieve the sizes of the dimensions */ - if((ret_value = H5T_get_array_dims(dt, dims)) < 0) + if((ret_value = H5T__get_array_dims(dt, dims)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unable to get dimension sizes") done: diff --git a/src/H5Tbit.c b/src/H5Tbit.c index f85ff14..79cf3a6 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -31,7 +31,7 @@ /*------------------------------------------------------------------------- - * Function: H5T_bit_copy + * Function: H5T__bit_copy * * Purpose: Copies bits from one vector to another. * @@ -43,13 +43,15 @@ *------------------------------------------------------------------------- */ void -H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, +H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_offset, size_t size) { size_t shift; size_t mask_lo, mask_hi; size_t s_idx, d_idx; + FUNC_ENTER_PACKAGE_NOERR + /* * Normalize the offset to be a byte number and a bit offset within that * byte. @@ -155,11 +157,13 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size -= nbits; } /* end while */ -} /* end H5T_bit_copy() */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5T__bit_copy() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_shift + * Function: H5T__bit_shift * * Purpose: Simulation of hardware shifting. Shifts a bit vector * in a way similar to shifting a variable value, like @@ -179,13 +183,13 @@ H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, *------------------------------------------------------------------------- */ herr_t -H5T_bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) +H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) { uint8_t tmp_buf[512]; /* Temporary buffer */ H5WB_t *wb = NULL; /* Wrapped buffer for temporary buffer */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(buf); @@ -195,7 +199,7 @@ H5T_bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) size_t abs_shift_dist = (size_t)ABS(shift_dist); if(abs_shift_dist >= size) - H5T_bit_set(buf, offset, size, 0); + H5T__bit_set(buf, offset, size, 0); else { size_t buf_size = (size / 8) + 1; /* Size of shift buffer needed */ uint8_t *shift_buf; /* Pointer to shift buffer */ @@ -211,18 +215,18 @@ H5T_bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) /* Shift vector by making copies */ if(shift_dist > 0) { /* left shift */ /* Copy part to be shifted to a temporary buffer */ - H5T_bit_copy(shift_buf, (size_t)0, buf, offset, size - abs_shift_dist); + H5T__bit_copy(shift_buf, (size_t)0, buf, offset, size - abs_shift_dist); /* Copy it back to the original buffer */ - H5T_bit_copy(buf, offset + abs_shift_dist, shift_buf, (size_t)0, size - abs_shift_dist); + H5T__bit_copy(buf, offset + abs_shift_dist, shift_buf, (size_t)0, size - abs_shift_dist); /* Zero-set the left part*/ - H5T_bit_set(buf, offset, abs_shift_dist, 0); + H5T__bit_set(buf, offset, abs_shift_dist, 0); } /* end if */ else { /* right shift */ - H5T_bit_copy(shift_buf, (size_t)0, buf, offset + abs_shift_dist, size - abs_shift_dist); - H5T_bit_copy(buf, offset, shift_buf, (size_t)0, size - abs_shift_dist); - H5T_bit_set(buf, offset + size - abs_shift_dist, abs_shift_dist, 0); + H5T__bit_copy(shift_buf, (size_t)0, buf, offset + abs_shift_dist, size - abs_shift_dist); + H5T__bit_copy(buf, offset, shift_buf, (size_t)0, size - abs_shift_dist); + H5T__bit_set(buf, offset + size - abs_shift_dist, abs_shift_dist, 0); } /* end else */ } /* end else */ } /* end if */ @@ -233,11 +237,11 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "can't close wrapped buffer") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_bit_shift() */ +} /* end H5T__bit_shift() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_get_d + * Function: H5T__bit_get_d * * Purpose: Return a small bit sequence as a number. Bit vector starts * at OFFSET and is SIZE bits long. @@ -253,17 +257,17 @@ done: *------------------------------------------------------------------------- */ uint64_t -H5T_bit_get_d(uint8_t *buf, size_t offset, size_t size) +H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size) { uint64_t val = 0; size_t i, hs; uint64_t ret_value; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(8 * sizeof(val) >= size); - H5T_bit_copy((uint8_t*)&val, (size_t)0, buf, offset, size); + H5T__bit_copy((uint8_t*)&val, (size_t)0, buf, offset, size); switch(H5T_native_order_g) { case H5T_ORDER_LE: break; @@ -290,11 +294,11 @@ H5T_bit_get_d(uint8_t *buf, size_t offset, size_t size) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_bit_get_d() */ +} /* end H5T__bit_get_d() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_set_d + * Function: H5T__bit_set_d * * Purpose: Sets part of a bit vector to the specified unsigned value. * @@ -306,10 +310,12 @@ done: *------------------------------------------------------------------------- */ void -H5T_bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) +H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) { size_t i, hs; + FUNC_ENTER_PACKAGE_NOERR + HDassert(8 * sizeof(val) >= size); switch(H5T_native_order_g) { @@ -332,12 +338,14 @@ H5T_bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) HDabort(); } /* end switch */ - H5T_bit_copy(buf, offset, (uint8_t*)&val, (size_t)0, size); -} /* end H5T_bit_set_d() */ + H5T__bit_copy(buf, offset, (uint8_t*)&val, (size_t)0, size); + + FUNC_LEAVE_NOAPI_VOID +} /* end H5T__bit_set_d() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_set + * Function: H5T__bit_set * * Purpose: Sets or clears bits in a contiguous region of a vector * beginning at bit OFFSET and continuing for SIZE bits. @@ -352,10 +360,12 @@ H5T_bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val) *------------------------------------------------------------------------- */ void -H5T_bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) +H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) { int idx; + FUNC_ENTER_PACKAGE_NOERR + /* Normalize */ idx = (int)offset / 8; offset %= 8; @@ -385,11 +395,13 @@ H5T_bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) else buf[idx] &= (uint8_t)(~(((unsigned)1 << size) - 1)); } /* end if */ -} /* end H5T_bit_set() */ + + FUNC_LEAVE_NOAPI_VOID +} /* end H5T__bit_set() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_find + * Function: H5T__bit_find * * Purpose: Finds the first bit with the specified VALUE within a region * of a bit vector. The region begins at OFFSET and continues @@ -409,7 +421,7 @@ H5T_bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value) *------------------------------------------------------------------------- */ ssize_t -H5T_bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, +H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value) { ssize_t base = (ssize_t)offset; @@ -417,8 +429,8 @@ H5T_bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, size_t iu; ssize_t ret_value = (-1); /* Return value */ - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ + FUNC_ENTER_PACKAGE_NOERR /* Some functions call this with value=TRUE */ HDassert(TRUE == 1); @@ -496,11 +508,11 @@ H5T_bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_bit_find() */ +} /* end H5T__bit_find() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_inc + * Function: H5T__bit_inc * * Purpose: Increment part of a bit field by adding 1. The bit field * starts with bit position START and is SIZE bits long. @@ -516,14 +528,14 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T_bit_inc(uint8_t *buf, size_t start, size_t size) +H5T__bit_inc(uint8_t *buf, size_t start, size_t size) { size_t idx = start / 8; unsigned carry = 1; unsigned acc, mask; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ + FUNC_ENTER_PACKAGE_NOERR HDassert(buf); @@ -566,11 +578,11 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size) } /* end if */ FUNC_LEAVE_NOAPI(carry ? TRUE : FALSE) -} /* end H5T_bit_inc() */ +} /* end H5T__bit_inc() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_dec + * Function: H5T__bit_dec * * Purpose: decrement part of a bit field by substracting 1. The bit * field starts with bit position START and is SIZE bits long. @@ -586,15 +598,15 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size) *------------------------------------------------------------------------- */ htri_t -H5T_bit_dec(uint8_t *buf, size_t start, size_t size) +H5T__bit_dec(uint8_t *buf, size_t start, size_t size) { size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp; unsigned borrow = 0; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ + FUNC_ENTER_PACKAGE_NOERR HDassert(buf); HDassert(size); @@ -645,11 +657,11 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) } /* end else */ FUNC_LEAVE_NOAPI(borrow ? TRUE : FALSE) -} /* end H5T_bit_dec() */ +} /* end H5T__bit_dec() */ /*------------------------------------------------------------------------- - * Function: H5T_bit_neg + * Function: H5T__bit_neg * * Purpose: negate part of a bit sequence. The bit * field starts with bit position START and is SIZE bits long. @@ -662,14 +674,14 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) *------------------------------------------------------------------------- */ void -H5T_bit_neg(uint8_t *buf, size_t start, size_t size) +H5T__bit_neg(uint8_t *buf, size_t start, size_t size) { size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp[1]; - /* Use FUNC_ENTER_NOAPI_NOINIT_NOERR here to avoid performance issues */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + /* Use FUNC_ENTER_PACKAGE_NOERR here to avoid performance issues */ + FUNC_ENTER_PACKAGE_NOERR HDassert(buf); HDassert(size); @@ -679,7 +691,7 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) /* Simply copy the negated bit field back to the original byte */ if((size + start - 1) / 8 > idx) { /*bit sequence doesn't end in the same byte as starts*/ - H5T_bit_copy(&(buf[idx]), pos, tmp, pos, (8-pos)); + H5T__bit_copy(&(buf[idx]), pos, tmp, pos, (8-pos)); idx++; size -= (8 - pos); @@ -694,12 +706,12 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) if(size > 0) { /* Similar to the first byte case, where sequence ends in the same byte as starts */ tmp[0] = (uint8_t)~buf[idx]; - H5T_bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size); + H5T__bit_copy(&(buf[idx]), (size_t)0, tmp, (size_t)0, size); } /* end if */ } /* end if */ else /* bit sequence ends in the same byte as starts */ - H5T_bit_copy(&(buf[idx]), pos, tmp, pos, size); + H5T__bit_copy(&(buf[idx]), pos, tmp, pos, size); FUNC_LEAVE_NOAPI_VOID -} /* end H5T_bit_neg() */ +} /* end H5T__bit_neg() */ diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index a49d66e..bfae624 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -186,7 +186,7 @@ H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, { H5O_obj_create_t ocrt_info; /* Information for object creation */ H5T_obj_create_t tcrt_info; /* Information for named datatype creation */ - H5T_state_t old_state = H5T_STATE_TRANSIENT; /* The state of the datatype before H5T_commit. */ + H5T_state_t old_state = H5T_STATE_TRANSIENT; /* The state of the datatype before H5T__commit. */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_PACKAGE @@ -299,7 +299,7 @@ H5Tcommit_anon(hid_t loc_id, hid_t type_id, hid_t tcpl_id, hid_t tapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not datatype access property list") /* Commit the type */ - if(H5T_commit(loc.oloc->file, type, tcpl_id, H5AC_dxpl_id) < 0) + if(H5T__commit(loc.oloc->file, type, tcpl_id, H5AC_dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype") /* Release the datatype's object header */ @@ -321,7 +321,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_commit + * Function: H5T__commit * * Purpose: Commit a type, giving it a name and causing it to become * immutable. @@ -334,7 +334,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) +H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) { H5O_loc_t temp_oloc; /* Temporary object header location */ H5G_name_t temp_path; /* Temporary path */ @@ -342,7 +342,7 @@ H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id) size_t dtype_size; /* Size of the datatype message */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE HDassert(file); HDassert(type); @@ -439,7 +439,7 @@ done: } /* end if */ FUNC_LEAVE_NOAPI(ret_value) -} /* H5T_commit() */ +} /* H5T__commit() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index e7142e5..b377b29 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -56,6 +56,7 @@ /* Local Prototypes */ /********************/ static herr_t H5T_pack(const H5T_t *dt); +static htri_t H5T_is_packed(const H5T_t *dt); /*********************/ @@ -298,7 +299,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_member_size + * Function: H5T__get_member_size * * Purpose: Returns the size of the specified member. * @@ -311,16 +312,15 @@ done: *------------------------------------------------------------------------- */ size_t -H5T_get_member_size(const H5T_t *dt, unsigned membno) +H5T__get_member_size(const H5T_t *dt, unsigned membno) { - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(dt); HDassert(membno < dt->shared->u.compnd.nmembs); - FUNC_LEAVE_NOAPI(dt->shared->u.compnd.memb[membno].type->shared->size) -} /* end H5T_get_member_size() */ +} /* end H5T__get_member_size() */ /*------------------------------------------------------------------------- @@ -370,7 +370,7 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Insert */ - if(H5T_insert(parent, name, offset, member) < 0) + if(H5T__insert(parent, name, offset, member) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "unable to insert member") done: @@ -416,7 +416,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_insert + * Function: H5T__insert * * Purpose: Adds a new MEMBER to the compound datatype PARENT. The new * member will have a NAME that is unique within PARENT and an @@ -431,14 +431,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) +H5T__insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) { unsigned idx; /* Index of member to insert */ size_t total_size; unsigned i; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* check args */ HDassert(parent && H5T_COMPOUND == parent->shared->type); @@ -492,7 +492,7 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) HDassert(!(parent->shared->u.compnd.packed)); /* Determine if the compound datatype becomes packed */ - H5T_update_packed(parent); + H5T__update_packed(parent); /* Set the "force conversion" flag if the field's datatype indicates */ if(member->shared->force_conv == TRUE) @@ -504,12 +504,12 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member) /* (can't use a partial datatype and later versions of the format are * more efficient, so might as well upgrade all members also... -QAK) */ - if(H5T_upgrade_version(parent, member->shared->version) < 0) + if(H5T__upgrade_version(parent, member->shared->version) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "can't upgrade member encoding version") done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_insert() */ +} /* end H5T__insert() */ /*------------------------------------------------------------------------- @@ -567,7 +567,7 @@ H5T_pack(const H5T_t *dt) } /* end for */ /* Remove padding between members */ - if(H5T_sort_value(dt, NULL) < 0) + if(H5T__sort_value(dt, NULL) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOMPARE, FAIL, "value sort failed") for(i = 0, offset = 0; i < dt->shared->u.compnd.nmembs; i++) { dt->shared->u.compnd.memb[i].offset = offset; @@ -602,7 +602,7 @@ done: * *------------------------------------------------------------------------- */ -htri_t +static htri_t H5T_is_packed(const H5T_t *dt) { htri_t ret_value = TRUE; /* Return value */ @@ -625,7 +625,7 @@ H5T_is_packed(const H5T_t *dt) /*------------------------------------------------------------------------- - * Function: H5T_update_packed + * Function: H5T__update_packed * * Purpose: Checks whether a datatype which is compound became packed * after recent changes. This function does not assume that @@ -642,11 +642,11 @@ H5T_is_packed(const H5T_t *dt) *------------------------------------------------------------------------- */ void -H5T_update_packed(const H5T_t *dt) +H5T__update_packed(const H5T_t *dt) { unsigned i; /* Index */ - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(dt); HDassert(dt->shared->type == H5T_COMPOUND); @@ -667,5 +667,5 @@ H5T_update_packed(const H5T_t *dt) dt->shared->u.compnd.packed = FALSE; FUNC_LEAVE_NOAPI_VOID -} /* end H5T_update_packed() */ +} /* end H5T__update_packed() */ diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 6795ef1..983922f 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -605,7 +605,7 @@ { \ herr_t ret_value=SUCCEED; /* Return value */ \ \ - FUNC_ENTER_NOAPI(FAIL) \ + FUNC_ENTER_PACKAGE \ \ { \ size_t elmtno; /*element number */ \ @@ -890,7 +890,7 @@ done: \ /* Local Typedefs */ /******************/ -/* Conversion data for H5T_conv_struct() */ +/* Conversion data for H5T__conv_struct() */ typedef struct H5T_conv_struct_t { int *src2dst; /*mapping from src to dst member num */ hid_t *src_memb_id; /*source member type ID's */ @@ -900,7 +900,7 @@ typedef struct H5T_conv_struct_t { unsigned src_nmembs; /*needed by free function */ } H5T_conv_struct_t; -/* Conversion data for H5T_conv_enum() */ +/* Conversion data for H5T__conv_enum() */ typedef struct H5T_enum_struct_t { int base; /*lowest `in' value */ int length; /*num elements in arrays */ @@ -972,7 +972,7 @@ H5T_init_conv_interface(void) /*------------------------------------------------------------------------- - * Function: H5T_conv_noop + * Function: H5T__conv_noop * * Purpose: The no-op conversion. The library knows about this * conversion without it being registered. @@ -985,14 +985,14 @@ H5T_init_conv_interface(void) *------------------------------------------------------------------------- */ herr_t -H5T_conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, +H5T__conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, size_t UNUSED nelmts, size_t UNUSED buf_stride, size_t UNUSED bkg_stride, void UNUSED *buf, void UNUSED *background, hid_t UNUSED dxpl_id) { herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -1012,14 +1012,14 @@ H5T_conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_noop() */ +} /* end H5T__conv_noop() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_order_opt + * Function: H5T__conv_order_opt * * Purpose: Convert one type to another when byte order is the only - * difference. This is the optimized version of H5T_conv_order() + * difference. This is the optimized version of H5T__conv_order() * for a handful of different sizes. * * Note: This is a soft conversion function. @@ -1034,7 +1034,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *background, hid_t UNUSED dxpl_id) @@ -1045,7 +1045,7 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t i; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -1415,11 +1415,11 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_order_opt() */ +} /* end H5T__conv_order_opt() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_order + * Function: H5T__conv_order * * Purpose: Convert one type to another when byte order is the only * difference. @@ -1442,7 +1442,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *background, hid_t UNUSED dxpl_id) { @@ -1453,7 +1453,7 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t j, md; herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -1515,11 +1515,11 @@ H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_order() */ +} /* end H5T__conv_order() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_b_b + * Function: H5T__conv_b_b * * Purpose: Convert from one bitfield to any other bitfield. * @@ -1537,7 +1537,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *background, hid_t dxpl_id) { @@ -1558,7 +1558,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -1676,7 +1676,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /* end if */ if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_copy(d, dst->shared->u.atomic.offset, + H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -1684,10 +1684,10 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*Don't reverse because user handles it*/ reverse = FALSE; } else { - H5T_bit_copy(d, dst->shared->u.atomic.offset, + H5T__bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); - H5T_bit_set(d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, + H5T__bit_set(d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, FALSE); } @@ -1696,11 +1696,11 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ switch(dst->shared->u.atomic.lsb_pad) { case H5T_PAD_ZERO: - H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, FALSE); + H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, FALSE); break; case H5T_PAD_ONE: - H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); + H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, TRUE); break; default: @@ -1709,11 +1709,11 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, msb_pad_offset = dst->shared->u.atomic.offset + dst->shared->u.atomic.prec; switch(dst->shared->u.atomic.msb_pad) { case H5T_PAD_ZERO: - H5T_bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, FALSE); + H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, FALSE); break; case H5T_PAD_ONE: - H5T_bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); + H5T__bit_set(d, msb_pad_offset, 8 * dst->shared->size - msb_pad_offset, TRUE); break; default: HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported MSB padding") @@ -1758,7 +1758,7 @@ done: if(src_rev) H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_b_b() */ +} /* end H5T__conv_b_b() */ /*------------------------------------------------------------------------- @@ -1887,8 +1887,8 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) /* * Insure that members are sorted. */ - H5T_sort_value(src, NULL); - H5T_sort_value(dst, NULL); + H5T__sort_value(src, NULL); + H5T__sort_value(dst, NULL); /* * Build a mapping from source member number to destination member @@ -1924,8 +1924,8 @@ H5T_conv_struct_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) else { /* Restore sorted conditions for the datatypes */ /* (Required for the src2dst array to be valid) */ - H5T_sort_value(src, NULL); - H5T_sort_value(dst, NULL); + H5T__sort_value(src, NULL); + H5T__sort_value(dst, NULL); } /* end else */ /* @@ -1999,7 +1999,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_subset + * Function: H5T__conv_struct_subset * * Purpose: A quick way to return a field in a struct private in this * file. The flag SMEMBS_SUBSET indicates whether the source @@ -2023,11 +2023,11 @@ done: *------------------------------------------------------------------------- */ H5T_subset_info_t * -H5T_conv_struct_subset(const H5T_cdata_t *cdata) +H5T__conv_struct_subset(const H5T_cdata_t *cdata) { H5T_conv_struct_t *priv; - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR HDassert(cdata); HDassert(cdata->priv); @@ -2035,11 +2035,11 @@ H5T_conv_struct_subset(const H5T_cdata_t *cdata) priv = (H5T_conv_struct_t *)(cdata->priv); FUNC_LEAVE_NOAPI((H5T_subset_info_t *) &priv->subset_info) -} /* end H5T_conv_struct_subset() */ +} /* end H5T__conv_struct_subset() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_struct + * Function: H5T__conv_struct * * Purpose: Converts between compound datatypes. This is a soft * conversion function. The algorithm is basically: @@ -2079,7 +2079,7 @@ H5T_conv_struct_subset(const H5T_cdata_t *cdata) *------------------------------------------------------------------------- */ herr_t -H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg, hid_t dxpl_id) { uint8_t *buf = (uint8_t *)_buf; /*cast for pointer arithmetic */ @@ -2098,7 +2098,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv); herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -2141,8 +2141,8 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Insure that members are sorted. */ - H5T_sort_value(src, NULL); - H5T_sort_value(dst, NULL); + H5T__sort_value(src, NULL); + H5T__sort_value(dst, NULL); src2dst = priv->src2dst; /* @@ -2254,14 +2254,14 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_struct() */ +} /* end H5T__conv_struct() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_struct_opt + * Function: H5T__conv_struct_opt * * Purpose: Converts between compound datatypes in a manner more - * efficient than the general-purpose H5T_conv_struct() + * efficient than the general-purpose H5T__conv_struct() * function. This function isn't applicable if the destination * is larger than the source type. This is a soft conversion * function. The algorithm is basically: @@ -2326,7 +2326,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *_bkg, hid_t dxpl_id) { @@ -2348,7 +2348,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, int i; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -2431,8 +2431,8 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* * Insure that members are sorted. */ - H5T_sort_value(src, NULL); - H5T_sort_value(dst, NULL); + H5T__sort_value(src, NULL); + H5T__sort_value(dst, NULL); /* * Calculate strides. If BUF_STRIDE is non-zero then convert one @@ -2550,13 +2550,13 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_struct_opt() */ +} /* end H5T__conv_struct_opt() */ /*------------------------------------------------------------------------- * Function: H5T_conv_enum_init * - * Purpose: Initialize information for H5T_conv_enum(). + * Purpose: Initialize information for H5T__conv_enum(). * * Return: Success: Non-negative * @@ -2593,8 +2593,8 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * symbol names and build a map from source member index to destination * member index. */ - H5T_sort_name(src, NULL); - H5T_sort_name(dst, NULL); + H5T__sort_name(src, NULL); + H5T__sort_name(dst, NULL); if(NULL == (priv->src2dst = (int *)H5MM_malloc(src->shared->u.enumer.nmembs * sizeof(int)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed") for(i = 0, j = 0; @@ -2686,7 +2686,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) } /* Sort source type by value and adjust src2dst[] appropriately */ - H5T_sort_value(src, priv->src2dst); + H5T__sort_value(src, priv->src2dst); done: if (ret_value<0 && priv) { @@ -2699,7 +2699,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_conv_enum + * Function: H5T__conv_enum * * Purpose: Converts one type of enumerated data to another. * @@ -2712,7 +2712,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *_buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -2729,7 +2729,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*counters */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -2777,9 +2777,9 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * sort keys are used here during conversion. See H5T_conv_enum_init(). But * we actually don't care about the source type's order when doing the O(1) * conversion algorithm, which is turned on by non-zero priv->length */ - H5T_sort_name(dst, NULL); + H5T__sort_name(dst, NULL); if(!priv->length) - H5T_sort_value(src, NULL); + H5T__sort_value(src, NULL); /* * Direction of conversion. @@ -2885,11 +2885,11 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_enum() */ +} /* end H5T__conv_enum() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_vlen + * Function: H5T__conv_vlen * * Purpose: Converts between VL datatypes in memory and on disk. * This is a soft conversion function. The algorithm is @@ -2929,7 +2929,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dxpl_id) { H5T_vlen_alloc_info_t _vl_alloc_info; /* VL allocation info buffer */ @@ -2959,7 +2959,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t elmtno; /*element number counter */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -3232,11 +3232,11 @@ done: tmp_buf = H5FL_BLK_FREE(vlen_seq, tmp_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_vlen() */ +} /* end H5T__conv_vlen() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_array + * Function: H5T__conv_array * * Purpose: Converts between array datatypes in memory and on disk. * This is a soft conversion function. @@ -3251,7 +3251,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void UNUSED *_bkg, hid_t dxpl_id) { @@ -3267,7 +3267,7 @@ H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, void *bkg_buf = NULL; /*temporary background buffer */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch (cdata->command) { case H5T_CONV_INIT: @@ -3378,11 +3378,11 @@ done: bkg_buf = H5FL_BLK_FREE(array_seq, bkg_buf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_array() */ +} /* end H5T__conv_array() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_i_i + * Function: H5T__conv_i_i * * Purpose: Convert one integer type to another. This is the catch-all * function for integer conversions and is probably not @@ -3410,7 +3410,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { @@ -3432,7 +3432,7 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -3532,7 +3532,7 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * What is the bit number for the msb bit of S which is set? The * bit number is relative to the significant part of the number. */ - sfirst = H5T_bit_find (s, src->shared->u.atomic.offset, src->shared->u.atomic.prec, + sfirst = H5T__bit_find (s, src->shared->u.atomic.offset, src->shared->u.atomic.prec, H5T_BIT_MSB, TRUE); first = (size_t)sfirst; @@ -3545,7 +3545,7 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * The source has no bits set and must therefore be zero. * Set the destination to zero. */ - H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); + H5T__bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); } else if (H5T_SGN_NONE==src->shared->u.atomic.u.i.sign && H5T_SGN_NONE==dst->shared->u.atomic.u.i.sign) { @@ -3556,9 +3556,9 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * destination will be set to the maximum possible value. */ if (src->shared->u.atomic.prec <= dst->shared->u.atomic.prec) { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); - H5T_bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, + H5T__bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, FALSE); } else if (first>=dst->shared->u.atomic.prec) { /*overflow*/ @@ -3569,14 +3569,14 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); + H5T__bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } @@ -3598,16 +3598,16 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); + H5T__bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else if (src->shared->u.atomic.prec < dst->shared->u.atomic.prec) { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec-1); - H5T_bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec-1, + H5T__bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec-1, (dst->shared->u.atomic.prec-src->shared->u.atomic.prec)+1, FALSE); } else if (first>=dst->shared->u.atomic.prec) { /*overflow - source is positive*/ @@ -3618,14 +3618,14 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) - H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); + H5T__bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } @@ -3645,20 +3645,20 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); - H5T_bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, FALSE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); + H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else if (src->shared->u.atomic.precshared->u.atomic.prec) { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); - H5T_bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, + H5T__bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, FALSE); } else { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } } else if (first+1 == src->shared->u.atomic.prec) { @@ -3669,7 +3669,7 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * destination is set to a negative number with the largest * possible magnitude. */ - ssize_t sfz = H5T_bit_find (s, src->shared->u.atomic.offset, + ssize_t sfz = H5T__bit_find (s, src->shared->u.atomic.offset, src->shared->u.atomic.prec-1, H5T_BIT_MSB, FALSE); size_t fz = (size_t)sfz; @@ -3682,18 +3682,18 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, FALSE); - H5T_bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, TRUE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, FALSE); + H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, TRUE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else if (src->shared->u.atomic.precshared->u.atomic.prec) { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); - H5T_bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, TRUE); + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); + H5T__bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, TRUE); } else { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } } else { @@ -3712,20 +3712,20 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); - H5T_bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, FALSE); + H5T__bit_set(d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); + H5T__bit_set(d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), (size_t)1, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) /*Don't reverse because user handles it already*/ reverse = FALSE; } else if (src->shared->u.atomic.precshared->u.atomic.prec) { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, src->shared->u.atomic.prec); - H5T_bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, + H5T__bit_set (d, dst->shared->u.atomic.offset+src->shared->u.atomic.prec, dst->shared->u.atomic.prec-src->shared->u.atomic.prec, FALSE); } else { - H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, + H5T__bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } } @@ -3735,11 +3735,11 @@ H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if (dst->shared->u.atomic.offset>0) { assert(H5T_PAD_ZERO==dst->shared->u.atomic.lsb_pad || H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad); - H5T_bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst->shared->u.atomic.offset, (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.lsb_pad)); } if (dst->shared->u.atomic.offset+dst->shared->u.atomic.prec!=8*dst->shared->size) { assert (H5T_PAD_ZERO==dst->shared->u.atomic.msb_pad || H5T_PAD_ONE==dst->shared->u.atomic.msb_pad); - H5T_bit_set (d, dst->shared->u.atomic.offset+dst->shared->u.atomic.prec, + H5T__bit_set (d, dst->shared->u.atomic.offset+dst->shared->u.atomic.prec, 8*dst->shared->size - (dst->shared->u.atomic.offset+ dst->shared->u.atomic.prec), (hbool_t)(H5T_PAD_ONE==dst->shared->u.atomic.msb_pad)); } @@ -3782,11 +3782,11 @@ done: if(src_rev) H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_i_i() */ +} /* end H5T__conv_i_i() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_f_f + * Function: H5T__conv_f_f * * Purpose: Convert one floating point type to another. This is a catch * all for floating point conversions and is probably not @@ -3817,7 +3817,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { @@ -3854,7 +3854,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /*return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -3978,21 +3978,21 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Find the sign bit value of the source. */ - sign = H5T_bit_get_d(s, src.u.f.sign, (size_t)1); + sign = H5T__bit_get_d(s, src.u.f.sign, (size_t)1); /* * Check for special cases: +0, -0, +Inf, -Inf, NaN */ - if (H5T_bit_find (s, src.u.f.mpos, src.u.f.msize, + if (H5T__bit_find (s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, TRUE)<0) { - if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, TRUE)<0) { /* +0 or -0 */ - H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, FALSE); - H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); + H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, FALSE); + H5T__bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); goto padding; - } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* +Inf or -Inf */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4007,14 +4007,14 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); + H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); + H5T__bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) - H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); + H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -4024,8 +4024,8 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto padding; } - } else if (H5T_NORM_NONE==src.u.f.norm && H5T_bit_find (s, src.u.f.mpos, src.u.f.msize-1, - H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, + H5T_BIT_LSB, TRUE)<0 && H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa @@ -4043,14 +4043,14 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); + H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); + H5T__bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) - H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); + H5T__bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, (size_t)1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -4062,7 +4062,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, #ifdef H5_VMS } /*Temporary solution to handle VAX special values*/ #else /*H5_VMS*/ - } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -4075,9 +4075,9 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { /* There are many NaN values, so we just set all bits of * the significand. */ - H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); - H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, TRUE); + H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); + H5T__bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -4094,7 +4094,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source bit field where it's located. Don't worry about * the exponent bias yet. */ - expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); if(expo==0) denormalized=TRUE; @@ -4107,12 +4107,12 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, mpos = src.u.f.mpos; mrsh = 0; if (0==expo || H5T_NORM_NONE==src.u.f.norm) { - if ((bitno=H5T_bit_find(s, src.u.f.mpos, src.u.f.msize, + if ((bitno=H5T__bit_find(s, src.u.f.mpos, src.u.f.msize, H5T_BIT_MSB, TRUE))>0) { msize = bitno; } else if (0==bitno) { msize = 1; - H5T_bit_set(s, src.u.f.mpos, (size_t)1, FALSE); + H5T__bit_set(s, src.u.f.mpos, (size_t)1, FALSE); } } else if (H5T_NORM_IMPLIED==src.u.f.norm) { msize = src.u.f.msize; @@ -4125,7 +4125,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * The sign for the destination is the same as the sign for the * source in all cases. */ - H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); + H5T__bit_copy (d, dst.u.f.sign, s, src.u.f.sign, (size_t)1); /* * Calculate the true source exponent by adjusting according to @@ -4158,7 +4158,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (expo < -(hssize_t)(dst.u.f.msize)) { /* The exponent is way too small. Result is zero. */ expo = 0; - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; } else if (expo<=0) { /* @@ -4188,7 +4188,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -4209,17 +4209,17 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, bitno = (ssize_t)(mrsh+msize - dst.u.f.msize); assert(bitno>=0 && (size_t)bitno<=msize); /*If the 1st bit being cut off is set and source isn't denormalized.*/ - if(H5T_bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { + if(H5T__bit_get_d(s, (mpos + bitno) - 1, (size_t)1) && !denormalized) { /*Don't do rounding if exponent is 111...110 and mantissa is 111...11. *To do rounding and increment exponent in this case will create an infinity value.*/ - if((H5T_bit_find(s, mpos+bitno, msize-bitno, H5T_BIT_LSB, FALSE)>=0 || expo=0 || expodst.u.f.msize+1) { - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); } else if (mrsh==dst.u.f.msize+1) { - H5T_bit_set(d, dst.u.f.mpos+1, dst.u.f.msize-1, FALSE); - H5T_bit_set(d, dst.u.f.mpos, (size_t)1, TRUE); + H5T__bit_set(d, dst.u.f.mpos+1, dst.u.f.msize-1, FALSE); + H5T__bit_set(d, dst.u.f.mpos, (size_t)1, TRUE); } else if (mrsh==dst.u.f.msize) { - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); - H5T_bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied); } else { if (mrsh>0) { - H5T_bit_set(d, dst.u.f.mpos+dst.u.f.msize-mrsh, mrsh, + H5T__bit_set(d, dst.u.f.mpos+dst.u.f.msize-mrsh, mrsh, FALSE); - H5T_bit_set_d(d, dst.u.f.mpos+dst.u.f.msize-mrsh, (size_t)2, + H5T__bit_set_d(d, dst.u.f.mpos+dst.u.f.msize-mrsh, (size_t)2, (hsize_t)implied); } if (mrsh+msize>=dst.u.f.msize) { - H5T_bit_copy(d, dst.u.f.mpos, + H5T__bit_copy(d, dst.u.f.mpos, s, (mpos+msize+mrsh-dst.u.f.msize), dst.u.f.msize-mrsh); } else { - H5T_bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), + H5T__bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), s, mpos, msize); - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize-(mrsh+msize), + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize-(mrsh+msize), FALSE); } } @@ -4275,7 +4275,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; - H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); + H5T__bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") else if(except_ret == H5T_CONV_HANDLED) { @@ -4288,7 +4288,7 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, carry = 0; H5_CHECK_OVERFLOW(expo,hssize_t,hsize_t); - H5T_bit_set_d(d, dst.u.f.epos, dst.u.f.esize, (hsize_t)expo); + H5T__bit_set_d(d, dst.u.f.epos, dst.u.f.esize, (hsize_t)expo); padding: @@ -4297,11 +4297,11 @@ H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if (dst.offset>0) { assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); - H5T_bit_set (d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); + H5T__bit_set (d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); - H5T_bit_set (d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+dst.prec), + H5T__bit_set (d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); } @@ -4359,11 +4359,11 @@ done: H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_f_f() */ +} /* end H5T__conv_f_f() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_s_s + * Function: H5T__conv_s_s * * Purpose: Convert one fixed-length string type to another. * @@ -4385,7 +4385,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4399,7 +4399,7 @@ H5T_conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t *dbuf=NULL; /*temp buf for overlap convers. */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -4592,11 +4592,11 @@ done: H5MM_xfree(dbuf); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_s_s() */ +} /* end H5T__conv_s_s() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_uchar + * Function: H5T__conv_schar_uchar * * Purpose: Converts `signed char' to `unsigned char' * @@ -4612,7 +4612,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4622,7 +4622,7 @@ H5T_conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_schar + * Function: H5T__conv_uchar_schar * * Purpose: Converts `unsigned char' to `signed char' * @@ -4638,7 +4638,7 @@ H5T_conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4648,7 +4648,7 @@ H5T_conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_short + * Function: H5T__conv_schar_short * * Purpose: Converts `signed char' to `short' * @@ -4664,7 +4664,7 @@ H5T_conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4674,7 +4674,7 @@ H5T_conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_ushort + * Function: H5T__conv_schar_ushort * * Purpose: Converts `signed char' to `unsigned short' * @@ -4690,7 +4690,7 @@ H5T_conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4700,7 +4700,7 @@ H5T_conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_short + * Function: H5T__conv_uchar_short * * Purpose: Converts `unsigned char' to `short' * @@ -4716,7 +4716,7 @@ H5T_conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4726,7 +4726,7 @@ H5T_conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_ushort + * Function: H5T__conv_uchar_ushort * * Purpose: Converts `unsigned char' to `unsigned short' * @@ -4742,7 +4742,7 @@ H5T_conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4752,7 +4752,7 @@ H5T_conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_int + * Function: H5T__conv_schar_int * * Purpose: Converts `signed char' to `int' * @@ -4768,7 +4768,7 @@ H5T_conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4777,7 +4777,7 @@ H5T_conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_uint + * Function: H5T__conv_schar_uint * * Purpose: Converts `signed char' to `unsigned int' * @@ -4793,7 +4793,7 @@ H5T_conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4802,7 +4802,7 @@ H5T_conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_int + * Function: H5T__conv_uchar_int * * Purpose: Converts `unsigned char' to `int' * @@ -4818,7 +4818,7 @@ H5T_conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4827,7 +4827,7 @@ H5T_conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_uint + * Function: H5T__conv_uchar_uint * * Purpose: Converts `unsigned char' to `unsigned int' * @@ -4843,7 +4843,7 @@ H5T_conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4852,7 +4852,7 @@ H5T_conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_long + * Function: H5T__conv_schar_long * * Purpose: Converts `signed char' to `long' * @@ -4868,7 +4868,7 @@ H5T_conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4877,7 +4877,7 @@ H5T_conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_ulong + * Function: H5T__conv_schar_ulong * * Purpose: Converts `signed char' to `unsigned long' * @@ -4893,7 +4893,7 @@ H5T_conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4903,7 +4903,7 @@ H5T_conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_long + * Function: H5T__conv_uchar_long * * Purpose: Converts `unsigned char' to `long' * @@ -4919,7 +4919,7 @@ H5T_conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -4928,7 +4928,7 @@ H5T_conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_ulong + * Function: H5T__conv_uchar_ulong * * Purpose: Converts `unsigned char' to `unsigned long' * @@ -4944,7 +4944,7 @@ H5T_conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4954,7 +4954,7 @@ H5T_conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_llong + * Function: H5T__conv_schar_llong * * Purpose: Converts `signed char' to `long long' * @@ -4970,7 +4970,7 @@ H5T_conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -4980,7 +4980,7 @@ H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_ullong + * Function: H5T__conv_schar_ullong * * Purpose: Converts `signed char' to `unsigned long long' * @@ -4996,7 +4996,7 @@ H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5006,7 +5006,7 @@ H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_llong + * Function: H5T__conv_uchar_llong * * Purpose: Converts `unsigned char' to `long long' * @@ -5022,7 +5022,7 @@ H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5032,7 +5032,7 @@ H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_ullong + * Function: H5T__conv_uchar_ullong * * Purpose: Converts `unsigned char' to `unsigned long long' * @@ -5048,7 +5048,7 @@ H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5058,7 +5058,7 @@ H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_schar + * Function: H5T__conv_short_schar * * Purpose: Converts `short' to `signed char' * @@ -5074,7 +5074,7 @@ H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5084,7 +5084,7 @@ H5T_conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_uchar + * Function: H5T__conv_short_uchar * * Purpose: Converts `short' to `unsigned char' * @@ -5100,7 +5100,7 @@ H5T_conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5110,7 +5110,7 @@ H5T_conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_schar + * Function: H5T__conv_ushort_schar * * Purpose: Converts `unsigned short' to `signed char' * @@ -5126,7 +5126,7 @@ H5T_conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5136,7 +5136,7 @@ H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_uchar + * Function: H5T__conv_ushort_uchar * * Purpose: Converts `unsigned short' to `unsigned char' * @@ -5152,7 +5152,7 @@ H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5162,7 +5162,7 @@ H5T_conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_ushort + * Function: H5T__conv_short_ushort * * Purpose: Converts `short' to `unsigned short' * @@ -5178,7 +5178,7 @@ H5T_conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5188,7 +5188,7 @@ H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_short + * Function: H5T__conv_ushort_short * * Purpose: Converts `unsigned short' to `short' * @@ -5204,7 +5204,7 @@ H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5214,7 +5214,7 @@ H5T_conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_int + * Function: H5T__conv_short_int * * Purpose: Converts `short' to `int' * @@ -5230,7 +5230,7 @@ H5T_conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5240,7 +5240,7 @@ H5T_conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_uint + * Function: H5T__conv_short_uint * * Purpose: Converts `short' to `unsigned int' * @@ -5256,7 +5256,7 @@ H5T_conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5266,7 +5266,7 @@ H5T_conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_int + * Function: H5T__conv_ushort_int * * Purpose: Converts `unsigned short' to `int' * @@ -5282,7 +5282,7 @@ H5T_conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5292,7 +5292,7 @@ H5T_conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_uint + * Function: H5T__conv_ushort_uint * * Purpose: Converts `unsigned short' to `unsigned int' * @@ -5308,7 +5308,7 @@ H5T_conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5318,7 +5318,7 @@ H5T_conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_long + * Function: H5T__conv_short_long * * Purpose: Converts `short' to `long' * @@ -5334,7 +5334,7 @@ H5T_conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5344,7 +5344,7 @@ H5T_conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_ulong + * Function: H5T__conv_short_ulong * * Purpose: Converts `short' to `unsigned long' * @@ -5360,7 +5360,7 @@ H5T_conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5370,7 +5370,7 @@ H5T_conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_long + * Function: H5T__conv_ushort_long * * Purpose: Converts `unsigned short' to `long' * @@ -5386,7 +5386,7 @@ H5T_conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5396,7 +5396,7 @@ H5T_conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_ulong + * Function: H5T__conv_ushort_ulong * * Purpose: Converts `unsigned short' to `unsigned long' * @@ -5412,7 +5412,7 @@ H5T_conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5422,7 +5422,7 @@ H5T_conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_llong + * Function: H5T__conv_short_llong * * Purpose: Converts `short' to `long long' * @@ -5438,7 +5438,7 @@ H5T_conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5448,7 +5448,7 @@ H5T_conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_ullong + * Function: H5T__conv_short_ullong * * Purpose: Converts `short' to `unsigned long long' * @@ -5464,7 +5464,7 @@ H5T_conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5474,7 +5474,7 @@ H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_llong + * Function: H5T__conv_ushort_llong * * Purpose: Converts `unsigned short' to `long long' * @@ -5490,7 +5490,7 @@ H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5500,7 +5500,7 @@ H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_ullong + * Function: H5T__conv_ushort_ullong * * Purpose: Converts `unsigned short' to `unsigned long long' * @@ -5516,7 +5516,7 @@ H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5526,7 +5526,7 @@ H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_schar + * Function: H5T__conv_int_schar * * Purpose: Converts `int' to `signed char' * @@ -5542,7 +5542,7 @@ H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5552,7 +5552,7 @@ H5T_conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_uchar + * Function: H5T__conv_int_uchar * * Purpose: Converts `int' to `unsigned char' * @@ -5568,7 +5568,7 @@ H5T_conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5578,7 +5578,7 @@ H5T_conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_schar + * Function: H5T__conv_uint_schar * * Purpose: Converts `unsigned int' to `signed char' * @@ -5594,7 +5594,7 @@ H5T_conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5604,7 +5604,7 @@ H5T_conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_uchar + * Function: H5T__conv_uint_uchar * * Purpose: Converts `unsigned int' to `unsigned char' * @@ -5620,7 +5620,7 @@ H5T_conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5630,7 +5630,7 @@ H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_short + * Function: H5T__conv_int_short * * Purpose: Converts `int' to `short' * @@ -5646,7 +5646,7 @@ H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5656,7 +5656,7 @@ H5T_conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_ushort + * Function: H5T__conv_int_ushort * * Purpose: Converts `int' to `unsigned short' * @@ -5672,7 +5672,7 @@ H5T_conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5682,7 +5682,7 @@ H5T_conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_short + * Function: H5T__conv_uint_short * * Purpose: Converts `unsigned int' to `short' * @@ -5698,7 +5698,7 @@ H5T_conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5708,7 +5708,7 @@ H5T_conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_ushort + * Function: H5T__conv_uint_ushort * * Purpose: Converts `unsigned int' to `unsigned short' * @@ -5724,7 +5724,7 @@ H5T_conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5734,7 +5734,7 @@ H5T_conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_uint + * Function: H5T__conv_int_uint * * Purpose: Converts `int' to `unsigned int' * @@ -5750,7 +5750,7 @@ H5T_conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5759,7 +5759,7 @@ H5T_conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_int + * Function: H5T__conv_uint_int * * Purpose: Converts `unsigned int' to `int' * @@ -5775,7 +5775,7 @@ H5T_conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5784,7 +5784,7 @@ H5T_conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_long + * Function: H5T__conv_int_long * * Purpose: Converts `int' to `long' * @@ -5800,7 +5800,7 @@ H5T_conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5809,7 +5809,7 @@ H5T_conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_ulong + * Function: H5T__conv_int_ulong * * Purpose: Converts `int' to `unsigned long' * @@ -5825,7 +5825,7 @@ H5T_conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5834,7 +5834,7 @@ H5T_conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_long + * Function: H5T__conv_uint_long * * Purpose: Converts `unsigned int' to `long' * @@ -5850,7 +5850,7 @@ H5T_conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5859,7 +5859,7 @@ H5T_conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_ulong + * Function: H5T__conv_uint_ulong * * Purpose: Converts `unsigned int' to `unsigned long' * @@ -5875,7 +5875,7 @@ H5T_conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5884,7 +5884,7 @@ H5T_conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_llong + * Function: H5T__conv_int_llong * * Purpose: Converts `int' to `long long' * @@ -5900,7 +5900,7 @@ H5T_conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5909,7 +5909,7 @@ H5T_conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_ullong + * Function: H5T__conv_int_ullong * * Purpose: Converts `int' to `unsigned long long' * @@ -5925,7 +5925,7 @@ H5T_conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5934,7 +5934,7 @@ H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_llong + * Function: H5T__conv_uint_llong * * Purpose: Converts `unsigned int' to `long long' * @@ -5950,7 +5950,7 @@ H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -5959,7 +5959,7 @@ H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_ullong + * Function: H5T__conv_uint_ullong * * Purpose: Converts `unsigned int' to `unsigned long long' * @@ -5975,7 +5975,7 @@ H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -5985,7 +5985,7 @@ H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_schar + * Function: H5T__conv_long_schar * * Purpose: Converts `long' to `signed char' * @@ -6001,7 +6001,7 @@ H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6010,7 +6010,7 @@ H5T_conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_uchar + * Function: H5T__conv_long_uchar * * Purpose: Converts `long' to `unsigned char' * @@ -6026,7 +6026,7 @@ H5T_conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6035,7 +6035,7 @@ H5T_conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_schar + * Function: H5T__conv_ulong_schar * * Purpose: Converts `unsigned long' to `signed char' * @@ -6051,7 +6051,7 @@ H5T_conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6061,7 +6061,7 @@ H5T_conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_uchar + * Function: H5T__conv_ulong_uchar * * Purpose: Converts `unsigned long' to `unsigned char' * @@ -6077,7 +6077,7 @@ H5T_conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6087,7 +6087,7 @@ H5T_conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_short + * Function: H5T__conv_long_short * * Purpose: Converts `long' to `short' * @@ -6103,7 +6103,7 @@ H5T_conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6112,7 +6112,7 @@ H5T_conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_ushort + * Function: H5T__conv_long_ushort * * Purpose: Converts `long' to `unsigned short' * @@ -6128,7 +6128,7 @@ H5T_conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6138,7 +6138,7 @@ H5T_conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_short + * Function: H5T__conv_ulong_short * * Purpose: Converts `unsigned long' to `short' * @@ -6154,7 +6154,7 @@ H5T_conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6163,7 +6163,7 @@ H5T_conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_ushort + * Function: H5T__conv_ulong_ushort * * Purpose: Converts `unsigned long' to `unsigned short' * @@ -6179,7 +6179,7 @@ H5T_conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6189,7 +6189,7 @@ H5T_conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_int + * Function: H5T__conv_long_int * * Purpose: Converts `long' to `int' * @@ -6205,7 +6205,7 @@ H5T_conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6214,7 +6214,7 @@ H5T_conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_uint + * Function: H5T__conv_long_uint * * Purpose: Converts `long' to `unsigned int' * @@ -6230,7 +6230,7 @@ H5T_conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6239,7 +6239,7 @@ H5T_conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_int + * Function: H5T__conv_ulong_int * * Purpose: Converts `unsigned long' to `int' * @@ -6255,7 +6255,7 @@ H5T_conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6264,7 +6264,7 @@ H5T_conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_uint + * Function: H5T__conv_ulong_uint * * Purpose: Converts `unsigned long' to `unsigned int' * @@ -6280,7 +6280,7 @@ H5T_conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6289,7 +6289,7 @@ H5T_conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_ulong + * Function: H5T__conv_long_ulong * * Purpose: Converts `long' to `unsigned long' * @@ -6305,7 +6305,7 @@ H5T_conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6314,7 +6314,7 @@ H5T_conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_long + * Function: H5T__conv_ulong_long * * Purpose: Converts `unsigned long' to `long' * @@ -6330,7 +6330,7 @@ H5T_conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6339,7 +6339,7 @@ H5T_conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_llong + * Function: H5T__conv_long_llong * * Purpose: Converts `long' to `long long' * @@ -6355,7 +6355,7 @@ H5T_conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6364,7 +6364,7 @@ H5T_conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_ullong + * Function: H5T__conv_long_ullong * * Purpose: Converts `long' to `unsigned long long' * @@ -6380,7 +6380,7 @@ H5T_conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6390,7 +6390,7 @@ H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_llong + * Function: H5T__conv_ulong_llong * * Purpose: Converts `unsigned long' to `long long' * @@ -6406,7 +6406,7 @@ H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6416,7 +6416,7 @@ H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_ullong + * Function: H5T__conv_ulong_ullong * * Purpose: Converts `unsigned long' to `unsigned long long' * @@ -6432,7 +6432,7 @@ H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6442,7 +6442,7 @@ H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_schar + * Function: H5T__conv_llong_schar * * Purpose: Converts `long long' to `signed char' * @@ -6458,7 +6458,7 @@ H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6468,7 +6468,7 @@ H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_uchar + * Function: H5T__conv_llong_uchar * * Purpose: Converts `long long' to `unsigned char' * @@ -6484,7 +6484,7 @@ H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6494,7 +6494,7 @@ H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_schar + * Function: H5T__conv_ullong_schar * * Purpose: Converts `unsigned long long' to `signed char' * @@ -6510,7 +6510,7 @@ H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6520,7 +6520,7 @@ H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_uchar + * Function: H5T__conv_ullong_uchar * * Purpose: Converts `unsigned long long' to `unsigned char' * @@ -6536,7 +6536,7 @@ H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6546,7 +6546,7 @@ H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_short + * Function: H5T__conv_llong_short * * Purpose: Converts `long long' to `short' * @@ -6562,7 +6562,7 @@ H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6572,7 +6572,7 @@ H5T_conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_ushort + * Function: H5T__conv_llong_ushort * * Purpose: Converts `long long' to `unsigned short' * @@ -6588,7 +6588,7 @@ H5T_conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6598,7 +6598,7 @@ H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_short + * Function: H5T__conv_ullong_short * * Purpose: Converts `unsigned long long' to `short' * @@ -6614,7 +6614,7 @@ H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6624,7 +6624,7 @@ H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_ushort + * Function: H5T__conv_ullong_ushort * * Purpose: Converts `unsigned long long' to `unsigned short' * @@ -6640,7 +6640,7 @@ H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6650,7 +6650,7 @@ H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_int + * Function: H5T__conv_llong_int * * Purpose: Converts `long long' to `int' * @@ -6666,7 +6666,7 @@ H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6675,7 +6675,7 @@ H5T_conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_uint + * Function: H5T__conv_llong_uint * * Purpose: Converts `long long' to `unsigned int' * @@ -6691,7 +6691,7 @@ H5T_conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6700,7 +6700,7 @@ H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_int + * Function: H5T__conv_ullong_int * * Purpose: Converts `unsigned long long' to `int' * @@ -6716,7 +6716,7 @@ H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6725,7 +6725,7 @@ H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_uint + * Function: H5T__conv_ullong_uint * * Purpose: Converts `unsigned long long' to `unsigned int' * @@ -6741,7 +6741,7 @@ H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6751,7 +6751,7 @@ H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_long + * Function: H5T__conv_llong_long * * Purpose: Converts `long long' to `long' * @@ -6767,7 +6767,7 @@ H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { @@ -6776,7 +6776,7 @@ H5T_conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_ulong + * Function: H5T__conv_llong_ulong * * Purpose: Converts `long long' to `unsigned long' * @@ -6792,7 +6792,7 @@ H5T_conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6802,7 +6802,7 @@ H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_long + * Function: H5T__conv_ullong_long * * Purpose: Converts `unsigned long long' to `long' * @@ -6818,7 +6818,7 @@ H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6828,7 +6828,7 @@ H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_ulong + * Function: H5T__conv_ullong_ulong * * Purpose: Converts `unsigned long long' to `unsigned long' * @@ -6844,7 +6844,7 @@ H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6854,7 +6854,7 @@ H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_ullong + * Function: H5T__conv_llong_ullong * * Purpose: Converts `long long' to `unsigned long long' * @@ -6870,7 +6870,7 @@ H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6880,7 +6880,7 @@ H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_llong + * Function: H5T__conv_ullong_llong * * Purpose: Converts `unsigned long long' to `long long' * @@ -6896,7 +6896,7 @@ H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6906,7 +6906,7 @@ H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_double + * Function: H5T__conv_float_double * * Purpose: Convert native `float' to native `double' using hardware. * This is a fast special case. @@ -6926,7 +6926,7 @@ H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_FP herr_t -H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6937,7 +6937,7 @@ H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_ldouble + * Function: H5T__conv_float_ldouble * * Purpose: Convert native `float' to native `long double' using hardware. * This is a fast special case. @@ -6953,7 +6953,7 @@ H5T_conv_float_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LDOUBLE herr_t -H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6964,7 +6964,7 @@ H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_float + * Function: H5T__conv_double_float * * Purpose: Convert native `double' to native `float' using hardware. * This is a fast special case. @@ -6987,7 +6987,7 @@ H5T_conv_float_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_FP herr_t -H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -6998,7 +6998,7 @@ H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_ldouble + * Function: H5T__conv_double_ldouble * * Purpose: Convert native `double' to native `long double' using hardware. * This is a fast special case. @@ -7014,7 +7014,7 @@ H5T_conv_double_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LDOUBLE herr_t -H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7025,7 +7025,7 @@ H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_float + * Function: H5T__conv_ldouble_float * * Purpose: Convert native `long double' to native `float' using hardware. * This is a fast special case. @@ -7041,7 +7041,7 @@ H5T_conv_double_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LDOUBLE herr_t -H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7052,7 +7052,7 @@ H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_double + * Function: H5T__conv_ldouble_double * * Purpose: Convert native `long double' to native `double' using hardware. * This is a fast special case. @@ -7068,7 +7068,7 @@ H5T_conv_ldouble_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LDOUBLE herr_t -H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7079,7 +7079,7 @@ H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_float + * Function: H5T__conv_schar_float * * Purpose: Convert native signed char to native float using hardware. * This is a fast special case. @@ -7094,7 +7094,7 @@ H5T_conv_ldouble_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7104,7 +7104,7 @@ H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_double + * Function: H5T__conv_schar_double * * Purpose: Convert native signed char to native double using hardware. * This is a fast special case. @@ -7119,7 +7119,7 @@ H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7129,7 +7129,7 @@ H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_schar_ldouble + * Function: H5T__conv_schar_ldouble * * Purpose: Convert native signed char to native long double using * hardware. This is a fast special case. @@ -7145,7 +7145,7 @@ H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7156,7 +7156,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_float + * Function: H5T__conv_uchar_float * * Purpose: Convert native unsigned char to native float using hardware. * This is a fast special case. @@ -7171,7 +7171,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7181,7 +7181,7 @@ H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_double + * Function: H5T__conv_uchar_double * * Purpose: Convert native unsigned char to native double using hardware. * This is a fast special case. @@ -7196,7 +7196,7 @@ H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7206,7 +7206,7 @@ H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uchar_ldouble + * Function: H5T__conv_uchar_ldouble * * Purpose: Convert native unsigned char to native long double using * hardware. This is a fast special case. @@ -7222,7 +7222,7 @@ H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7233,7 +7233,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_float + * Function: H5T__conv_short_float * * Purpose: Convert native short to native float using hardware. * This is a fast special case. @@ -7248,7 +7248,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7258,7 +7258,7 @@ H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_double + * Function: H5T__conv_short_double * * Purpose: Convert native short to native double using hardware. * This is a fast special case. @@ -7273,7 +7273,7 @@ H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7283,7 +7283,7 @@ H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_short_ldouble + * Function: H5T__conv_short_ldouble * * Purpose: Convert native short to native long double using hardware. * This is a fast special case. @@ -7299,7 +7299,7 @@ H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7310,7 +7310,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_float + * Function: H5T__conv_ushort_float * * Purpose: Convert native unsigned short to native float using hardware. * This is a fast special case. @@ -7325,7 +7325,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7335,7 +7335,7 @@ H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_double + * Function: H5T__conv_ushort_double * * Purpose: Convert native unsigned short to native double using hardware. * This is a fast special case. @@ -7350,7 +7350,7 @@ H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7360,7 +7360,7 @@ H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ushort_ldouble + * Function: H5T__conv_ushort_ldouble * * Purpose: Convert native unsigned short to native long double using * hardware. This is a fast special case. @@ -7376,7 +7376,7 @@ H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7387,7 +7387,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_float + * Function: H5T__conv_int_float * * Purpose: Convert native integer to native float using hardware. * This is a fast special case. @@ -7402,7 +7402,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7412,7 +7412,7 @@ H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_double + * Function: H5T__conv_int_double * * Purpose: Convert native integer to native double using hardware. * This is a fast special case. @@ -7427,7 +7427,7 @@ H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7437,7 +7437,7 @@ H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_int_ldouble + * Function: H5T__conv_int_ldouble * * Purpose: Convert native integer to native long double using hardware. * This is a fast special case. @@ -7453,7 +7453,7 @@ H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7464,7 +7464,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_float + * Function: H5T__conv_uint_float * * Purpose: Convert native unsigned integer to native float using * hardware. This is a fast special case. @@ -7479,7 +7479,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7489,7 +7489,7 @@ H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_double + * Function: H5T__conv_uint_double * * Purpose: Convert native unsigned integer to native double using * hardware. This is a fast special case. @@ -7504,7 +7504,7 @@ H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7514,7 +7514,7 @@ H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_uint_ldouble + * Function: H5T__conv_uint_ldouble * * Purpose: Convert native unsigned integer to native long double using * hardware. This is a fast special case. @@ -7530,7 +7530,7 @@ H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7541,7 +7541,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_float + * Function: H5T__conv_long_float * * Purpose: Convert native long to native float using hardware. * This is a fast special case. @@ -7556,7 +7556,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7566,7 +7566,7 @@ H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_double + * Function: H5T__conv_long_double * * Purpose: Convert native long to native double using hardware. * This is a fast special case. @@ -7581,7 +7581,7 @@ H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7591,7 +7591,7 @@ H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_long_ldouble + * Function: H5T__conv_long_ldouble * * Purpose: Convert native long to native long double using hardware. * This is a fast special case. @@ -7607,7 +7607,7 @@ H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_INTEGER_LDOUBLE herr_t -H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7618,7 +7618,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_float + * Function: H5T__conv_ulong_float * * Purpose: Convert native unsigned long to native float using hardware. * This is a fast special case. @@ -7634,7 +7634,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULONG_FLT herr_t -H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7645,7 +7645,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_double + * Function: H5T__conv_ulong_double * * Purpose: Convert native unsigned long to native double using hardware. * This is a fast special case. @@ -7661,7 +7661,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULONG_DBL herr_t -H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7672,7 +7672,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ulong_ldouble + * Function: H5T__conv_ulong_ldouble * * Purpose: Convert native unsigned long to native long double using * hardware. This is a fast special case. @@ -7688,7 +7688,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULONG_LDOUBLE herr_t -H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7699,7 +7699,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_float + * Function: H5T__conv_llong_float * * Purpose: Convert native long long to native float using hardware. * This is a fast special case. @@ -7714,7 +7714,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7724,7 +7724,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_double + * Function: H5T__conv_llong_double * * Purpose: Convert native long long to native double using hardware. * This is a fast special case. @@ -7739,7 +7739,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7749,7 +7749,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_llong_ldouble + * Function: H5T__conv_llong_ldouble * * Purpose: Convert native long long to native long double using * hardware. This is a fast special case. @@ -7765,7 +7765,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LLONG_LDOUBLE herr_t -H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7776,7 +7776,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_float + * Function: H5T__conv_ullong_float * * Purpose: Convert native unsigned long long to native float using * hardware. This is a fast special case. @@ -7792,7 +7792,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULLONG_FP herr_t -H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7803,7 +7803,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_double + * Function: H5T__conv_ullong_double * * Purpose: Convert native unsigned long long to native double using * hardware. This is a fast special case. @@ -7819,7 +7819,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULLONG_FP herr_t -H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7830,7 +7830,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ullong_ldouble + * Function: H5T__conv_ullong_ldouble * * Purpose: Convert native unsigned long long to native long double using * hardware. This is a fast special case. @@ -7846,7 +7846,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_ULLONG_LDOUBLE herr_t -H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7857,7 +7857,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_schar + * Function: H5T__conv_float_schar * * Purpose: Convert native float to native signed char using * hardware. This is a fast special case. @@ -7872,7 +7872,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7882,7 +7882,7 @@ H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_uchar + * Function: H5T__conv_float_uchar * * Purpose: Convert native float to native unsigned char using * hardware. This is a fast special case. @@ -7897,7 +7897,7 @@ H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7907,7 +7907,7 @@ H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_schar + * Function: H5T__conv_double_schar * * Purpose: Convert native double to native signed char using * hardware. This is a fast special case. @@ -7922,7 +7922,7 @@ H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7932,7 +7932,7 @@ H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_uchar + * Function: H5T__conv_double_uchar * * Purpose: Convert native double to native unsigned char using * hardware. This is a fast special case. @@ -7947,7 +7947,7 @@ H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7957,7 +7957,7 @@ H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_schar + * Function: H5T__conv_ldouble_schar * * Purpose: Convert native long double to native signed char using * hardware. This is a fast special case. @@ -7973,7 +7973,7 @@ H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -7984,7 +7984,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_uchar + * Function: H5T__conv_ldouble_uchar * * Purpose: Convert native long double to native unsigned char using * hardware. This is a fast special case. @@ -8000,7 +8000,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8011,7 +8011,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_short + * Function: H5T__conv_float_short * * Purpose: Convert native float to native short using * hardware. This is a fast special case. @@ -8026,7 +8026,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8036,7 +8036,7 @@ H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_ushort + * Function: H5T__conv_float_ushort * * Purpose: Convert native float to native unsigned short using * hardware. This is a fast special case. @@ -8051,7 +8051,7 @@ H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8061,7 +8061,7 @@ H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_short + * Function: H5T__conv_double_short * * Purpose: Convert native double to native short using * hardware. This is a fast special case. @@ -8076,7 +8076,7 @@ H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8086,7 +8086,7 @@ H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_ushort + * Function: H5T__conv_double_ushort * * Purpose: Convert native double to native unsigned short using * hardware. This is a fast special case. @@ -8101,7 +8101,7 @@ H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8111,7 +8111,7 @@ H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_short + * Function: H5T__conv_ldouble_short * * Purpose: Convert native long double to native short using * hardware. This is a fast special case. @@ -8127,7 +8127,7 @@ H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8138,7 +8138,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_ushort + * Function: H5T__conv_ldouble_ushort * * Purpose: Convert native long double to native unsigned short using * hardware. This is a fast special case. @@ -8154,7 +8154,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8165,7 +8165,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_int + * Function: H5T__conv_float_int * * Purpose: Convert native float to native int using * hardware. This is a fast special case. @@ -8180,7 +8180,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8190,7 +8190,7 @@ H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_uint + * Function: H5T__conv_float_uint * * Purpose: Convert native float to native unsigned int using * hardware. This is a fast special case. @@ -8205,7 +8205,7 @@ H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8215,7 +8215,7 @@ H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_int + * Function: H5T__conv_double_int * * Purpose: Convert native double to native int using * hardware. This is a fast special case. @@ -8230,7 +8230,7 @@ H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8240,7 +8240,7 @@ H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_uint + * Function: H5T__conv_double_uint * * Purpose: Convert native double to native unsigned int using * hardware. This is a fast special case. @@ -8255,7 +8255,7 @@ H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8265,7 +8265,7 @@ H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_int + * Function: H5T__conv_ldouble_int * * Purpose: Convert native long double to native int using * hardware. This is a fast special case. @@ -8281,7 +8281,7 @@ H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8292,7 +8292,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_uint + * Function: H5T__conv_ldouble_uint * * Purpose: Convert native long double to native unsigned int using * hardware. This is a fast special case. @@ -8308,7 +8308,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_UINT herr_t -H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8319,7 +8319,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_long + * Function: H5T__conv_float_long * * Purpose: Convert native float to native long using * hardware. This is a fast special case. @@ -8334,7 +8334,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8344,7 +8344,7 @@ H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_ulong + * Function: H5T__conv_float_ulong * * Purpose: Convert native float to native unsigned long using * hardware. This is a fast special case. @@ -8359,7 +8359,7 @@ H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8369,7 +8369,7 @@ H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_long + * Function: H5T__conv_double_long * * Purpose: Convert native double to native long using * hardware. This is a fast special case. @@ -8384,7 +8384,7 @@ H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8394,7 +8394,7 @@ H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_ulong + * Function: H5T__conv_double_ulong * * Purpose: Convert native double to native unsigned long using * hardware. This is a fast special case. @@ -8409,7 +8409,7 @@ H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8419,7 +8419,7 @@ H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_long + * Function: H5T__conv_ldouble_long * * Purpose: Convert native long double to native long using * hardware. This is a fast special case. @@ -8435,7 +8435,7 @@ H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8446,7 +8446,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_ulong + * Function: H5T__conv_ldouble_ulong * * Purpose: Convert native long double to native unsigned long using * hardware. This is a fast special case. @@ -8462,7 +8462,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_INTEGER herr_t -H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8473,7 +8473,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_llong + * Function: H5T__conv_float_llong * * Purpose: Convert native float to native long long using * hardware. This is a fast special case. @@ -8489,7 +8489,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LLONG herr_t -H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8500,7 +8500,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_float_ullong + * Function: H5T__conv_float_ullong * * Purpose: Convert native float to native unsigned long long using * hardware. This is a fast special case. @@ -8516,7 +8516,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_ULLONG herr_t -H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8527,7 +8527,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_llong + * Function: H5T__conv_double_llong * * Purpose: Convert native double to native long long using * hardware. This is a fast special case. @@ -8543,7 +8543,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_LLONG herr_t -H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8554,7 +8554,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_double_ullong + * Function: H5T__conv_double_ullong * * Purpose: Convert native double to native unsigned long long using * hardware. This is a fast special case. @@ -8570,7 +8570,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_FP_ULLONG herr_t -H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) @@ -8581,7 +8581,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_llong + * Function: H5T__conv_ldouble_llong * * Purpose: Convert native long double to native long long using * hardware. This is a fast special case. @@ -8597,7 +8597,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_LLONG herr_t -H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) @@ -8608,7 +8608,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_ldouble_ullong + * Function: H5T__conv_ldouble_ullong * * Purpose: Convert native long double to native unsigned long long using * hardware. This is a fast special case. @@ -8624,7 +8624,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, */ #if H5T_CONV_INTERNAL_LDOUBLE_ULLONG herr_t -H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5T__conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) @@ -8635,7 +8635,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /*------------------------------------------------------------------------- - * Function: H5T_conv_f_i + * Function: H5T__conv_f_i * * Purpose: Convert one floating-point type to an integer. This is * the catch-all function for float-integer conversions and @@ -8659,7 +8659,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, *------------------------------------------------------------------------- */ herr_t -H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { @@ -8693,7 +8693,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -8818,24 +8818,24 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /*zero-set all destination bits*/ - H5T_bit_set (d, dst.offset, dst.prec, FALSE); + H5T__bit_set (d, dst.offset, dst.prec, FALSE); /* * Find the sign bit value of the source. */ - sign = H5T_bit_get_d(s, src.u.f.sign, (size_t)1); + sign = H5T__bit_get_d(s, src.u.f.sign, (size_t)1); /* * Check for special cases: +0, -0, +Inf, -Inf, NaN */ - if (H5T_bit_find (s, src.u.f.mpos, src.u.f.msize, + if (H5T__bit_find (s, src.u.f.mpos, src.u.f.msize, H5T_BIT_LSB, TRUE)<0) { - if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, TRUE)<0) { /* +0 or -0 */ /* Set all bits to zero */ goto padding; - } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* +Infinity or -Infinity */ if(sign) { /* -Infinity */ @@ -8848,7 +8848,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_2==dst.u.i.sign) - H5T_bit_set (d, dst.prec-1, (size_t)1, TRUE); + H5T__bit_set (d, dst.prec-1, (size_t)1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -8865,9 +8865,9 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_NONE==dst.u.i.sign) - H5T_bit_set (d, dst.offset, dst.prec, TRUE); + H5T__bit_set (d, dst.offset, dst.prec, TRUE); else if (H5T_SGN_2==dst.u.i.sign) - H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); + H5T__bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -8877,8 +8877,8 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } goto padding; } - } else if (H5T_NORM_NONE==src.u.f.norm && H5T_bit_find (s, src.u.f.mpos, src.u.f.msize-1, - H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T_NORM_NONE==src.u.f.norm && H5T__bit_find (s, src.u.f.mpos, src.u.f.msize-1, + H5T_BIT_LSB, TRUE)<0 && H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa @@ -8894,7 +8894,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_2==dst.u.i.sign) - H5T_bit_set (d, dst.prec-1, (size_t)1, TRUE); + H5T__bit_set (d, dst.prec-1, (size_t)1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -8911,9 +8911,9 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { if (H5T_SGN_NONE==dst.u.i.sign) - H5T_bit_set (d, dst.offset, dst.prec, TRUE); + H5T__bit_set (d, dst.offset, dst.prec, TRUE); else if (H5T_SGN_2==dst.u.i.sign) - H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); + H5T__bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ reverse = FALSE; @@ -8922,7 +8922,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } goto padding; - } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, + } else if (H5T__bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /* NaN */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -8950,7 +8950,7 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the source bit field where it's located. Not expecting * exponent to be greater than the maximal value of hssize_t. */ - expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); + expo = H5T__bit_get_d(s, src.u.f.epos, src.u.f.esize); /* * Calculate the true source exponent by adjusting according to @@ -8975,14 +8975,14 @@ H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * V V V V * buf[0] buf[1] buf[2] buf[3] */ - H5T_bit_copy(int_buf, (size_t)0, s, src.u.f.mpos, src.u.f.msize); + H5T__bit_copy(int_buf, (size_t)0, s, src.u.f.mpos, src.u.f.msize); /* * Restore the implicit bit for mantissa if it's implied. * Equivalent to mantissa |= (hsize_t)1<0) { assert (H5T_PAD_ZERO==dst.lsb_pad || H5T_PAD_ONE==dst.lsb_pad); - H5T_bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if (dst.offset+dst.prec!=8*dst_p->shared->size) { assert (H5T_PAD_ZERO==dst.msb_pad || H5T_PAD_ONE==dst.msb_pad); - H5T_bit_set(d, dst.offset+dst.prec, + H5T__bit_set(d, dst.offset+dst.prec, 8*dst_p->shared->size - (dst.offset+ dst.prec), (hbool_t)(H5T_PAD_ONE==dst.msb_pad)); } @@ -9218,11 +9218,11 @@ done: H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_f_i() */ +} /* end H5T__conv_f_i() */ /*------------------------------------------------------------------------- - * Function: H5T_conv_i_f + * Function: H5T__conv_i_f * * Purpose: Convert one integer type to a floating-point type. This is * the catch-all function for integer-float conversions and @@ -9246,7 +9246,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, +H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t dxpl_id) { @@ -9282,7 +9282,7 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE switch(cdata->command) { case H5T_CONV_INIT: @@ -9399,28 +9399,28 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } /*zero-set all destination bits*/ - H5T_bit_set (d, dst.offset, dst.prec, FALSE); + H5T__bit_set (d, dst.offset, dst.prec, FALSE); /* Copy source into a temporary buffer */ - H5T_bit_copy(int_buf, (size_t)0, s, src.offset, src.prec); + H5T__bit_copy(int_buf, (size_t)0, s, src.offset, src.prec); /* * Find the sign bit value of the source. */ if(H5T_SGN_2 == src.u.i.sign) - sign = (size_t)H5T_bit_get_d(int_buf, src.prec - 1, (size_t)1); + sign = (size_t)H5T__bit_get_d(int_buf, src.prec - 1, (size_t)1); /* * What is the bit position(starting from 0 as first one) for the most significant * bit(MSB) of S which is set? */ if(H5T_SGN_2 == src.u.i.sign) { - sfirst = H5T_bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); if(sign && sfirst < 0) /* The case 0x80...00, which is negative with maximal value */ is_max_neg = 1; } else if(H5T_SGN_NONE == src.u.i.sign) - sfirst = H5T_bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec, H5T_BIT_MSB, TRUE); /* Handle special cases here. Integer is zero */ if(!sign && sfirst < 0) @@ -9432,9 +9432,9 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_SGN_2 == src.u.i.sign && sign) { if(!is_max_neg) { /* Equivalent to ~(i - 1) */ - H5T_bit_dec(int_buf, (size_t)0, buf_size * 8); - H5T_bit_neg(int_buf, (size_t)0, buf_size * 8); - sfirst = H5T_bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); + H5T__bit_dec(int_buf, (size_t)0, buf_size * 8); + H5T__bit_neg(int_buf, (size_t)0, buf_size * 8); + sfirst = H5T__bit_find(int_buf, (size_t)0, src.prec - 1, H5T_BIT_MSB, TRUE); } else { /* If it's maximal negative number 0x80...000, treat it as if it overflowed * (create a carry) to help conversion. i.e. a character type number 0x80 @@ -9449,10 +9449,10 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of * sign bit to 0 in the temporary buffer because they're all negated from the previous * step. */ - H5T_bit_set(int_buf, src.prec, (buf_size * 8) - src.prec, 0); + H5T__bit_set(int_buf, src.prec, (buf_size * 8) - src.prec, 0); /* Set sign bit in destination */ - H5T_bit_set_d(d, dst.u.f.sign, (size_t)1, (hsize_t)sign); + H5T__bit_set_d(d, dst.u.f.sign, (size_t)1, (hsize_t)sign); } /* end if */ first = (size_t)sfirst; @@ -9472,7 +9472,7 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Handle mantissa part here */ if (H5T_NORM_IMPLIED==dst.u.f.norm) { /* Imply first bit */ - H5T_bit_set(int_buf, first, (size_t)1, 0); + H5T__bit_set(int_buf, first, (size_t)1, 0); } else if (H5T_NORM_NONE==dst.u.f.norm) { first++; } @@ -9501,28 +9501,28 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ /* Check 1st dropoff bit, see if it's set. */ - if(H5T_bit_get_d(int_buf, ((first - dst.u.f.msize) - 1), (size_t)1)) { + if(H5T__bit_get_d(int_buf, ((first - dst.u.f.msize) - 1), (size_t)1)) { /* Check all bits after 1st dropoff bit, see if any of them is set. */ - if(((first - dst.u.f.msize) - 1) > 0 && H5T_bit_get_d(int_buf, (size_t)0, ((first - dst.u.f.msize) - 1))) + if(((first - dst.u.f.msize) - 1) > 0 && H5T__bit_get_d(int_buf, (size_t)0, ((first - dst.u.f.msize) - 1))) do_round = 1; else { /* The .50...0 case */ /* Check if the least significant bit is odd. */ - if(H5T_bit_get_d(int_buf, (first - dst.u.f.msize), (size_t)1)) + if(H5T__bit_get_d(int_buf, (first - dst.u.f.msize), (size_t)1)) do_round = 1; } } /* Right shift to drop off extra bits */ - H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, buf_size * 8); + H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, buf_size * 8); if(do_round) { - H5T_bit_inc(int_buf, (size_t)0, buf_size * 8); + H5T__bit_inc(int_buf, (size_t)0, buf_size * 8); do_round = 0; /* If integer is like 0x0ff...fff and we need to round up the * last f, we get 0x100...000. Treat this special case here. */ - if(H5T_bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) { + if(H5T__bit_get_d(int_buf, dst.u.f.msize, (size_t)1)) { if (H5T_NORM_IMPLIED==dst.u.f.norm) { /* The bit at this 1's position was impled already, so this * number should be 0x200...000. We need to increment the @@ -9533,7 +9533,7 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Right shift 1 bit to let the carried 1 fit in the mantissa, * and increment exponent by 1. */ - H5T_bit_shift(int_buf, (ssize_t)-1, (size_t)0, buf_size * 8); + H5T__bit_shift(int_buf, (ssize_t)-1, (size_t)0, buf_size * 8); expo++; } } @@ -9541,7 +9541,7 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /* The bit sequence can fit mantissa part. Left shift to fit in from high-order of * bit position. */ - H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, dst.u.f.msize); + H5T__bit_shift(int_buf, (ssize_t)(dst.u.f.msize - first), (size_t)0, dst.u.f.msize); } @@ -9570,10 +9570,10 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(except_ret == H5T_CONV_UNHANDLED) { /* Set exponent in destination */ - H5T_bit_set_d(d, dst.u.f.epos, dst.u.f.esize, expo); + H5T__bit_set_d(d, dst.u.f.epos, dst.u.f.esize, expo); /* Copy mantissa into destination */ - H5T_bit_copy(d, dst.u.f.mpos, int_buf, (size_t)0, (buf_size * 8) > dst.u.f.msize ? dst.u.f.msize : buf_size * 8); + H5T__bit_copy(d, dst.u.f.mpos, int_buf, (size_t)0, (buf_size * 8) > dst.u.f.msize ? dst.u.f.msize : buf_size * 8); } padding: @@ -9582,11 +9582,11 @@ H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, */ if(dst.offset > 0) { HDassert(H5T_PAD_ZERO == dst.lsb_pad || H5T_PAD_ONE == dst.lsb_pad); - H5T_bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); + H5T__bit_set(d, (size_t)0, dst.offset, (hbool_t)(H5T_PAD_ONE==dst.lsb_pad)); } if(dst.offset + dst.prec != 8 * dst_p->shared->size) { HDassert(H5T_PAD_ZERO == dst.msb_pad || H5T_PAD_ONE == dst.msb_pad); - H5T_bit_set(d, dst.offset + dst.prec, + H5T__bit_set(d, dst.offset + dst.prec, 8 * dst_p->shared->size - (dst.offset + dst.prec), (hbool_t)(H5T_PAD_ONE == dst.msb_pad)); } @@ -9648,7 +9648,7 @@ done: H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_conv_i_f() */ +} /* end H5T__conv_i_f() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tdbg.c b/src/H5Tdbg.c index c161f9f..e5df7ff 100644 --- a/src/H5Tdbg.c +++ b/src/H5Tdbg.c @@ -76,7 +76,7 @@ /*------------------------------------------------------------------------- - * Function: H5T_print_stats + * Function: H5T__print_stats * * Purpose: Print statistics about a conversion path. Statistics are * printed only if all the following conditions are true: @@ -102,14 +102,14 @@ *------------------------------------------------------------------------- */ herr_t -H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) +H5T__print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) { #ifdef H5T_DEBUG hsize_t nbytes; char bandwidth[32]; #endif - FUNC_ENTER_NOAPI_NOINIT_NOERR + FUNC_ENTER_PACKAGE_NOERR #ifdef H5T_DEBUG if(H5DEBUG(T) && path->stats.ncalls > 0) { @@ -143,7 +143,7 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) } #endif FUNC_LEAVE_NOAPI(SUCCEED) -} /* end H5T_print_stats() */ +} /* end H5T__print_stats() */ /*------------------------------------------------------------------------- diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 1e3d760..8e4e8a2 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -91,7 +91,7 @@ H5Tenum_create(hid_t parent_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type") /* Build new type */ - if((dt=H5T_enum_create(parent))==NULL) + if(NULL == (dt = H5T__enum_create(parent))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "cannot create enum type") /* Atomize the type */ if ((ret_value=H5I_register(H5I_DATATYPE, dt, TRUE))<0) @@ -103,7 +103,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_create + * Function: H5T__enum_create * * Purpose: Private function for H5Tenum_create. Create a new * enumeration data type based on the specified @@ -121,16 +121,16 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_enum_create(const H5T_t *parent) +H5T__enum_create(const H5T_t *parent) { H5T_t *ret_value; /*new enumeration data type */ - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE assert(parent); /* Build new type */ - if(NULL == (ret_value = H5T_alloc())) + if(NULL == (ret_value = H5T__alloc())) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") ret_value->shared->type = H5T_ENUM; ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL); @@ -183,7 +183,7 @@ H5Tenum_insert(hid_t type, const char *name, const void *value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no value specified") /* Do work */ - if (H5T_enum_insert(dt, name, value)<0) + if(H5T__enum_insert(dt, name, value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to insert new enumeration member") done: @@ -192,7 +192,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_enum_insert + * Function: H5T__enum_insert * * Purpose: Insert a new member having a NAME and VALUE into an * enumeration data TYPE. The NAME and VALUE must both be @@ -211,14 +211,14 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_enum_insert(const H5T_t *dt, const char *name, const void *value) +H5T__enum_insert(const H5T_t *dt, const char *name, const void *value) { unsigned i; char **names=NULL; uint8_t *values=NULL; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE assert(dt); assert(name && *name); @@ -292,7 +292,7 @@ H5Tget_member_value(hid_t type, unsigned membno, void *value/*out*/) if (!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null value buffer") - if (H5T_get_member_value(dt, membno, value)<0) + if(H5T__get_member_value(dt, membno, value) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "unable to get member value") done: FUNC_LEAVE_API(ret_value) @@ -300,9 +300,9 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_member_value + * Function: H5T__get_member_value * - * Purpose: Private function for H5T_get_member_value. Return the + * Purpose: Private function for H5T__get_member_value. Return the * value for an enumeration data type member. * * Return: Success: non-negative with the member value copied @@ -318,19 +318,16 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) +H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE_NOERR assert(dt); assert(value); HDmemcpy(value, dt->shared->u.enumer.value + membno*dt->shared->size, dt->shared->size); -done: - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -439,7 +436,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si * and search on the copied datatype to protect the original order. */ if(NULL == (copied_dt = H5T_copy(dt, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy data type") - if(H5T_sort_value(copied_dt, NULL) < 0) + if(H5T__sort_value(copied_dt, NULL) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCOMPARE, NULL, "value sort failed") lt = 0; @@ -578,7 +575,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) * and search on the copied datatype to protect the original order. */ if (NULL==(copied_dt=H5T_copy(dt, H5T_COPY_ALL))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to copy data type"); - if(H5T_sort_name(copied_dt, NULL)<0) + if(H5T__sort_name(copied_dt, NULL) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOMPARE, FAIL, "value sort failed") lt = 0; diff --git a/src/H5Tfields.c b/src/H5Tfields.c index a208f75..aa1efe8 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -168,7 +168,7 @@ H5Tget_member_name(hid_t type_id, unsigned membno) if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype") - if((ret_value = H5T_get_member_name(dt, membno))==NULL) + if(NULL == (ret_value = H5T__get_member_name(dt, membno))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get member name") done: @@ -177,7 +177,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_get_member_name + * Function: H5T__get_member_name * * Purpose: Private function for H5Tget_member_name. Returns the name * of a member of a compound or enumeration datatype. Members @@ -196,11 +196,11 @@ done: *------------------------------------------------------------------------- */ char * -H5T_get_member_name(H5T_t const *dt, unsigned membno) +H5T__get_member_name(H5T_t const *dt, unsigned membno) { char *ret_value; - FUNC_ENTER_NOAPI(NULL) + FUNC_ENTER_PACKAGE assert(dt); @@ -283,7 +283,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_sort_value + * Function: H5T__sort_value * * Purpose: Sorts the members of a compound datatype by their offsets; * sorts the members of an enum type by their values. This even @@ -299,7 +299,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_sort_value(const H5T_t *dt, int *map) +H5T__sort_value(const H5T_t *dt, int *map) { unsigned nmembs; /* Number of members for datatype */ size_t size; @@ -308,7 +308,7 @@ H5T_sort_value(const H5T_t *dt, int *map) unsigned i, j; /* Local index variables */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ HDassert(dt); @@ -383,11 +383,11 @@ H5T_sort_value(const H5T_t *dt, int *map) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_sort_value() */ +} /* end H5T__sort_value() */ /*------------------------------------------------------------------------- - * Function: H5T_sort_name + * Function: H5T__sort_name * * Purpose: Sorts members of a compound or enumeration datatype by their * names. This even works for locked datatypes since it doesn't @@ -405,7 +405,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5T_sort_name(const H5T_t *dt, int *map) +H5T__sort_name(const H5T_t *dt, int *map) { unsigned i, j, nmembs; size_t size; @@ -413,7 +413,7 @@ H5T_sort_name(const H5T_t *dt, int *map) uint8_t tbuf[32]; herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Check args */ assert(dt); diff --git a/src/H5Tnative.c b/src/H5Tnative.c index 50bb96e..b9192f9 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -290,7 +290,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if(NULL == (memb_type = H5T_get_member_type(dtype, u, H5T_COPY_TRANSIENT))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") - if(NULL == (comp_mname[u] = H5T_get_member_name(dtype, u))) + if(NULL == (comp_mname[u] = H5T__get_member_name(dtype, u))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed") if(NULL == (memb_list[u] = H5T_get_native_type(memb_type, direction, &children_st_align, &(memb_offset[u]), &children_size))) @@ -305,12 +305,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig children_size += children_st_align - (children_size % children_st_align); /* Construct new compound type based on native type */ - if(NULL == (new_type = H5T_create(H5T_COMPOUND, children_size))) + if(NULL == (new_type = H5T__create(H5T_COMPOUND, children_size))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot create a compound type") /* Insert members for the new compound type */ for(u = 0; u < nmemb; u++) - if(H5T_insert(new_type, comp_mname[u], memb_offset[u], memb_list[u]) < 0) + if(H5T__insert(new_type, comp_mname[u], memb_offset[u], memb_list[u]) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype") /* Update size, offset and compound alignment for parent in the case of @@ -377,7 +377,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") /* Construct new enum type based on native type */ - if(NULL == (new_type=H5T_enum_create(nat_super_type))) + if(NULL == (new_type = H5T__enum_create(nat_super_type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type") /* Retrieve member info and insert members into new enum type */ @@ -385,16 +385,16 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumerate data type doesn't have any member") H5_ASSIGN_OVERFLOW(nmemb, snmemb, int, unsigned); for(u = 0; u < nmemb; u++) { - if(NULL == (memb_name = H5T_get_member_name(dtype, u))) + if(NULL == (memb_name = H5T__get_member_name(dtype, u))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member name") - if(H5T_get_member_value(dtype, u, tmp_memb_value) < 0) + if(H5T__get_member_value(dtype, u, tmp_memb_value) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type)); if(H5Tconvert(super_type_id, nat_super_type_id, (size_t)1, memb_value, NULL, H5P_DEFAULT) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value") - if(H5T_enum_insert(new_type, memb_name, memb_value) < 0) + if(H5T__enum_insert(new_type, memb_name, memb_value) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member") memb_name = (char *)H5MM_xfree(memb_name); } @@ -422,12 +422,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig size_t super_align = 0; /* Retrieve dimension information for array data type */ - if((sarray_rank = H5T_get_array_ndims(dtype)) <= 0) + if((sarray_rank = H5T__get_array_ndims(dtype)) <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension rank") H5_ASSIGN_OVERFLOW(array_rank, sarray_rank, int, unsigned); if(NULL == (dims = (hsize_t*)H5MM_malloc(array_rank * sizeof(hsize_t)))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") - if(H5T_get_array_dims(dtype, dims) < 0) + if(H5T__get_array_dims(dtype, dims) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension size") /* Retrieve base type for array type */ @@ -442,7 +442,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ - if(NULL == (new_type = H5T_array_create(nat_super_type, array_rank, dims))) + if(NULL == (new_type = H5T__array_create(nat_super_type, array_rank, dims))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type") /* Close base type */ @@ -480,7 +480,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype") /* Create a new array type based on native type */ - if(NULL == (new_type = H5T_vlen_create(nat_super_type))) + if(NULL == (new_type = H5T__vlen_create(nat_super_type))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type") /* Close base type */ diff --git a/src/H5Toh.c b/src/H5Toh.c index be853f1..7961706 100644 --- a/src/H5Toh.c +++ b/src/H5Toh.c @@ -183,7 +183,7 @@ H5O_dtype_create(H5F_t *f, void *_crt_info, H5G_loc_t *obj_loc, hid_t dxpl_id) HDassert(obj_loc); /* Commit the type to the file */ - if(H5T_commit(f, crt_info->dt, crt_info->tcpl_id, dxpl_id) < 0) + if(H5T__commit(f, crt_info->dt, crt_info->tcpl_id, dxpl_id) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to commit datatype") /* Set up the new named datatype's location */ diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index f25fb1e..6736920 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -378,7 +378,7 @@ typedef struct H5T_shared_t { H5T_class_t type; /*which class of type is this? */ size_t size; /*total size of an instance of this type */ unsigned version; /* Version of object header message to encode this object with */ - hbool_t force_conv;/* Set if this type always needs to be converted and H5T_conv_noop cannot be called */ + hbool_t force_conv;/* Set if this type always needs to be converted and H5T__conv_noop cannot be called */ struct H5T_t *parent;/*parent type for derived datatypes */ union { H5T_atomic_t atomic; /* an atomic datatype */ @@ -511,899 +511,897 @@ H5FL_EXTERN(H5T_t); H5FL_EXTERN(H5T_shared_t); /* Common functions */ -H5_DLL H5T_t *H5T_create(H5T_class_t type, size_t size); -H5_DLL herr_t H5T_commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); +H5_DLL H5T_t *H5T__create(H5T_class_t type, size_t size); +H5_DLL herr_t H5T__commit(H5F_t *file, H5T_t *type, hid_t tcpl_id, hid_t dxpl_id); H5_DLL herr_t H5T__commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id, hid_t dxpl_id); -H5_DLL H5T_t *H5T_alloc(void); -H5_DLL herr_t H5T_free(H5T_t *dt); -H5_DLL herr_t H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, +H5_DLL H5T_t *H5T__alloc(void); +H5_DLL herr_t H5T__free(H5T_t *dt); +H5_DLL herr_t H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value); -H5_DLL herr_t H5T_set_size(H5T_t *dt, size_t size); -H5_DLL herr_t H5T_upgrade_version(H5T_t *dt, unsigned new_version); +H5_DLL herr_t H5T__upgrade_version(H5T_t *dt, unsigned new_version); /* Conversion functions */ -H5_DLL herr_t H5T_conv_noop(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_noop(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_order(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_array(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_i_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_f_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_f_i(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_i_f(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_s_s(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *_buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_schar_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_uchar_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_schar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_schar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_uchar_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, +H5_DLL herr_t H5T__conv_uchar_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_schar_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_schar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uchar_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uchar_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_short_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_short_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ushort_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ushort_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_int_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_int_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_uint_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_uint_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_long_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_long_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ulong_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ulong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_llong_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_llong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_float(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_float(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_double(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_double(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ullong_ldouble(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ullong_ldouble(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_float_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_float_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_double_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_double_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_schar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_uchar(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_short(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_short(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_ushort(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_int(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_int(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_uint(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_uint(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_long(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_long(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_ulong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_ulong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_llong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_llong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); -H5_DLL herr_t H5T_conv_ldouble_ullong(hid_t src_id, hid_t dst_id, +H5_DLL herr_t H5T__conv_ldouble_ullong(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, void *buf, void *bkg, hid_t dset_xfer_plist); /* Bit twiddling functions */ -H5_DLL void H5T_bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, +H5_DLL void H5T__bit_copy(uint8_t *dst, size_t dst_offset, const uint8_t *src, size_t src_offset, size_t size); -H5_DLL herr_t H5T_bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size); -H5_DLL void H5T_bit_set(uint8_t *buf, size_t offset, size_t size, +H5_DLL herr_t H5T__bit_shift(uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size); +H5_DLL void H5T__bit_set(uint8_t *buf, size_t offset, size_t size, hbool_t value); -H5_DLL uint64_t H5T_bit_get_d(uint8_t *buf, size_t offset, size_t size); -H5_DLL void H5T_bit_set_d(uint8_t *buf, size_t offset, size_t size, +H5_DLL uint64_t H5T__bit_get_d(uint8_t *buf, size_t offset, size_t size); +H5_DLL void H5T__bit_set_d(uint8_t *buf, size_t offset, size_t size, uint64_t val); -H5_DLL ssize_t H5T_bit_find(uint8_t *buf, size_t offset, size_t size, +H5_DLL ssize_t H5T__bit_find(uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, hbool_t value); -H5_DLL htri_t H5T_bit_inc(uint8_t *buf, size_t start, size_t size); -H5_DLL htri_t H5T_bit_dec(uint8_t *buf, size_t start, size_t size); -H5_DLL void H5T_bit_neg(uint8_t *buf, size_t start, size_t size); +H5_DLL htri_t H5T__bit_inc(uint8_t *buf, size_t start, size_t size); +H5_DLL htri_t H5T__bit_dec(uint8_t *buf, size_t start, size_t size); +H5_DLL void H5T__bit_neg(uint8_t *buf, size_t start, size_t size); /* VL functions */ -H5_DLL H5T_t * H5T_vlen_create(const H5T_t *base); -H5_DLL htri_t H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc); +H5_DLL H5T_t * H5T__vlen_create(const H5T_t *base); +H5_DLL htri_t H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc); /* Array functions */ -H5_DLL H5T_t *H5T_array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]); -H5_DLL int H5T_get_array_ndims(const H5T_t *dt); -H5_DLL int H5T_get_array_dims(const H5T_t *dt, hsize_t dims[]); +H5_DLL H5T_t *H5T__array_create(H5T_t *base, unsigned ndims, const hsize_t dim[/* ndims */]); +H5_DLL int H5T__get_array_ndims(const H5T_t *dt); +H5_DLL int H5T__get_array_dims(const H5T_t *dt, hsize_t dims[]); /* Compound functions */ -H5_DLL herr_t H5T_insert(H5T_t *parent, const char *name, size_t offset, +H5_DLL herr_t H5T__insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member); -H5_DLL size_t H5T_get_member_size(const H5T_t *dt, unsigned membno); -H5_DLL htri_t H5T_is_packed(const H5T_t *dt); -H5_DLL void H5T_update_packed(const H5T_t *dt); -H5_DLL H5T_subset_info_t *H5T_conv_struct_subset(const H5T_cdata_t *cdata); +H5_DLL size_t H5T__get_member_size(const H5T_t *dt, unsigned membno); +H5_DLL void H5T__update_packed(const H5T_t *dt); +H5_DLL H5T_subset_info_t *H5T__conv_struct_subset(const H5T_cdata_t *cdata); /* Enumerated type functions */ -H5_DLL H5T_t *H5T_enum_create(const H5T_t *parent); -H5_DLL herr_t H5T_enum_insert(const H5T_t *dt, const char *name, const void *value); -H5_DLL herr_t H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value); +H5_DLL H5T_t *H5T__enum_create(const H5T_t *parent); +H5_DLL herr_t H5T__enum_insert(const H5T_t *dt, const char *name, const void *value); +H5_DLL herr_t H5T__get_member_value(const H5T_t *dt, unsigned membno, void *value); /* Field functions (for both compound & enumerated types) */ -H5_DLL char *H5T_get_member_name(H5T_t const *dt, unsigned membno); -H5_DLL herr_t H5T_sort_value(const H5T_t *dt, int *map); -H5_DLL herr_t H5T_sort_name(const H5T_t *dt, int *map); +H5_DLL char *H5T__get_member_name(H5T_t const *dt, unsigned membno); +H5_DLL herr_t H5T__sort_value(const H5T_t *dt, int *map); +H5_DLL herr_t H5T__sort_name(const H5T_t *dt, int *map); /* Debugging functions */ -H5_DLL herr_t H5T_print_stats(H5T_path_t *path, int *nprint/*in,out*/); +H5_DLL herr_t H5T__print_stats(H5T_path_t *path, int *nprint/*in,out*/); #endif /* _H5Tpkg_H */ diff --git a/src/H5Tvisit.c b/src/H5Tvisit.c index a1843ef..68cabda 100644 --- a/src/H5Tvisit.c +++ b/src/H5Tvisit.c @@ -83,7 +83,7 @@ /*------------------------------------------------------------------------- - * Function: H5T_visit + * Function: H5T__visit * * Purpose: Visit a datatype and all it's members and/or parents, making * a callback for each. @@ -96,12 +96,12 @@ *------------------------------------------------------------------------- */ herr_t -H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) +H5T__visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) { hbool_t is_complex; /* Flag indicating current datatype is "complex" */ herr_t ret_value = SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(FAIL) + FUNC_ENTER_PACKAGE /* Sanity check */ HDassert(dt); @@ -123,7 +123,7 @@ H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) /* Visit each member of the compound datatype */ for(u = 0; u < dt->shared->u.compnd.nmembs; u++) - if(H5T_visit(dt->shared->u.compnd.memb[u].type, visit_flags, op, op_value) < 0) + if(H5T__visit(dt->shared->u.compnd.memb[u].type, visit_flags, op, op_value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit member datatype") } /* end case */ break; @@ -132,7 +132,7 @@ H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) case H5T_VLEN: case H5T_ENUM: /* Visit parent type */ - if(H5T_visit(dt->shared->parent, visit_flags, op, op_value) < 0) + if(H5T__visit(dt->shared->parent, visit_flags, op, op_value) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADITER, FAIL, "can't visit parent datatype") break; @@ -151,5 +151,5 @@ H5T_visit(H5T_t *dt, unsigned visit_flags, H5T_operator_t op, void *op_value) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_visit() */ +} /* end H5T__visit() */ diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 267692c..f497d1e 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -117,7 +117,7 @@ H5Tvlen_create(hid_t base_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an valid base datatype") /* Create up VL datatype */ - if((dt = H5T_vlen_create(base)) == NULL) + if((dt = H5T__vlen_create(base)) == NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location") /* Atomize the type */ @@ -130,7 +130,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5T_vlen_create + * Function: H5T__vlen_create * * Purpose: Create a new variable-length datatype based on the specified * BASE_TYPE. @@ -145,18 +145,18 @@ done: *------------------------------------------------------------------------- */ H5T_t * -H5T_vlen_create(const H5T_t *base) +H5T__vlen_create(const H5T_t *base) { H5T_t *dt = NULL; /*new VL datatype */ H5T_t *ret_value; /*return value */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* Check args */ HDassert(base); /* Build new type */ - if(NULL == (dt = H5T_alloc())) + if(NULL == (dt = H5T__alloc())) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTALLOC, NULL, "memory allocation failed") dt->shared->type = H5T_VLEN; @@ -187,11 +187,11 @@ done: HDONE_ERROR(H5E_DATATYPE, H5E_CANTRELEASE, NULL, "unable to release datatype info") FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_create() */ +} /* end H5T__vlen_create() */ /*------------------------------------------------------------------------- - * Function: H5T_vlen_set_loc + * Function: H5T__vlen_set_loc * * Purpose: Sets the location of a VL datatype to be either on disk or in memory * @@ -207,11 +207,11 @@ done: *------------------------------------------------------------------------- */ htri_t -H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) +H5T__vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) { htri_t ret_value = FALSE; /* Indicate success, but no location change */ - FUNC_ENTER_NOAPI_NOINIT + FUNC_ENTER_PACKAGE /* check parameters */ HDassert(dt); @@ -298,7 +298,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) done: FUNC_LEAVE_NOAPI(ret_value) -} /* end H5T_vlen_set_loc() */ +} /* end H5T__vlen_set_loc() */ /*------------------------------------------------------------------------- diff --git a/src/H5detect.c b/src/H5detect.c index 98fd6ae..87a4fd5 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -648,7 +648,7 @@ H5TN_init_interface(void)\n\ /* The part common to fixed and floating types */ printf("\ - if(NULL == (dt = H5T_alloc()))\n\ + if(NULL == (dt = H5T__alloc()))\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\ dt->shared->state = H5T_STATE_IMMUTABLE;\n\ dt->shared->type = H5T_%s;\n\ diff --git a/src/H5private.h b/src/H5private.h index 37480cb..76d8a05 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1917,6 +1917,30 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); H5_PUSH_FUNC \ { +/* Use this macro for all "normal" staticly-scoped functions */ +#define FUNC_ENTER_STATIC { \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + { + +/* Use this macro for staticly-scoped functions which propgate errors, but don't issue them */ +#define FUNC_ENTER_STATIC_NOERR { \ + FUNC_ENTER_COMMON_NOERR(H5_IS_PKG(FUNC)); \ + H5_PUSH_FUNC \ + { + +/* Use the following macro as replacement for the FUNC_ENTER_STATIC + * macro when the function needs to set up a metadata tag. */ +#define FUNC_ENTER_STATIC_TAG(dxpl_id, tag, err) { \ + haddr_t prev_tag = HADDR_UNDEF; \ + hid_t tag_dxpl_id = dxpl_id; \ + \ + FUNC_ENTER_COMMON(H5_IS_PKG(FUNC)); \ + if(H5AC_tag(tag_dxpl_id, tag, &prev_tag) < 0) \ + HGOTO_ERROR(H5E_CACHE, H5E_CANTTAG, err, "unable to apply metadata tag") \ + H5_PUSH_FUNC \ + { + /* Use this macro for all non-API functions, which propagate errors, but don't issue them */ #define FUNC_ENTER_NOAPI_NOERR { \ FUNC_ENTER_COMMON_NOERR(!H5_IS_API(FUNC)); \ @@ -2160,11 +2184,11 @@ extern hbool_t H5_api_entered_g; /* Has library already been entered through {{{ /* Macros for substituting the package name */ -#define FUNC_ENTER_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) -#define FUNC_ENTER_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) -#define FUNC_ENTER_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) -#define FUNC_ENTER_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENT_STATIC H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENT_PKGINIT H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, INIT) +#define FUNC_ENT_PKG H5_PACKAGE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT, REG) +#define FUNC_ENT_PRIV H5_PRIVATE_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) +#define FUNC_ENT_PUB H5_PUBLIC_ENTER(H5_MY_PKG, H5_MY_PKG_INIT) /* Macros for substituting a function prefix */ #define FUNC_PREFIX_STATIC static @@ -2190,7 +2214,7 @@ func \ { \ ret_typ ret_value = ret_init; \ H5_GLUE(FUNC_ERR_VAR_, use_err)(ret_typ, err) \ - H5_GLUE(FUNC_ENTER_, scope) + H5_GLUE(FUNC_ENT_, scope) /* Macros for label when a function initialization can fail */ #define H5_PRIV_YES_FUNC_INIT_FAILED func_init_failed: diff --git a/test/bittests.c b/test/bittests.c index f063cee..c527bb8 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -56,13 +56,13 @@ test_find (void) /* The zero length buffer */ HDmemset(v1, 0xaa, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_LSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero length test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, (size_t)0, H5T_BIT_MSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero length test failed (msb)!"); @@ -72,13 +72,13 @@ test_find (void) /* The zero buffer */ HDmemset(v1, 0, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero buffer test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); if(-1 != n) { H5_FAILED(); puts (" Zero buffer test failed (msb)!"); @@ -89,13 +89,13 @@ test_find (void) for(i = 0; i < 8 * (int)sizeof(v1); i++) { HDmemset(v1, 0, sizeof v1); v1[i / 8] = 1 << (i % 8); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, TRUE); if((ssize_t)i != n) { H5_FAILED(); printf (" Test for set bit %d failed (lsb)!\n", i); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, TRUE); if((ssize_t)i != n) { H5_FAILED(); printf (" Test for set bit %d failed (msb)!\n", i); @@ -105,13 +105,13 @@ test_find (void) /* The one buffer */ HDmemset(v1, 0xff, sizeof v1); - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_LSB, FALSE); if(-1 != n) { H5_FAILED(); puts (" One buffer test failed (lsb)!"); goto failed; } - n = H5T_bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE); + n = H5T__bit_find(v1, (size_t)0, 8 * sizeof(v1), H5T_BIT_MSB, FALSE); if(-1 != n) { H5_FAILED(); puts (" One buffer test failed (msb)!"); @@ -122,13 +122,13 @@ test_find (void) for (i=0; i<8*(int)sizeof(v1); i++) { memset (v1, 0xff, sizeof v1); v1[i/8] &= ~(1<<(i%8)); - n = H5T_bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE); + n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_LSB, FALSE); if ((ssize_t)i!=n) { H5_FAILED(); printf (" Test for clear bit %d failed (lsb)!\n", i); goto failed; } - n = H5T_bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE); + n = H5T__bit_find (v1, (size_t)0, 8*sizeof(v1), H5T_BIT_MSB, FALSE); if ((ssize_t)i!=n) { H5_FAILED(); printf (" Test for clear bit %d failed (lsb)!\n", i); @@ -183,7 +183,7 @@ test_copy (void) memset (v2, 0x00, sizeof v2); /* Copy some bits to v2 and make sure something was copied */ - H5T_bit_copy (v2, d_offset, v1, s_offset, size); + H5T__bit_copy (v2, d_offset, v1, s_offset, size); for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -198,7 +198,7 @@ test_copy (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first copied bit in destination " @@ -210,7 +210,7 @@ test_copy (void) puts (" Found copied bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last copied bit in destination " @@ -227,7 +227,7 @@ test_copy (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last copied bit in destination " @@ -239,7 +239,7 @@ test_copy (void) puts (" Found copied bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of copied data " @@ -305,12 +305,12 @@ test_shift (void) /*-------- LEFT-shift some bits and make sure something was shifted --------*/ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, shift_dist, offset, size); + H5T__bit_shift (vector, shift_dist, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset+shift_dist) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -322,7 +322,7 @@ test_shift (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -332,12 +332,12 @@ test_shift (void) /*-------- RIGHT-shift some bits and make sure something was shifted --------*/ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, -shift_dist, offset, size); + H5T__bit_shift (vector, -shift_dist, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -349,7 +349,7 @@ test_shift (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-shift_dist-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -367,12 +367,12 @@ test_shift (void) shift_dist = -((ssize_t)size); memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); - H5T_bit_shift (vector, shift_dist, offset, size); + H5T__bit_shift (vector, shift_dist, offset, size); /* Supposed to fail to find any ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (n >= 0) { H5_FAILED(); printf (" Unable to verify all bits are zero in destination(LSB) " @@ -381,7 +381,7 @@ test_shift (void) } /* Look from the other direction */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n >= 0) { H5_FAILED(); printf (" Unable to verify all bits are zero in destination(MSB) " @@ -437,15 +437,15 @@ test_increment (void) memset (vector, 0x00, sizeof vector); if(size>1) /* if size=6, make a sequence like 011111 */ - H5T_bit_set (vector, offset, size-1, 1); + H5T__bit_set (vector, offset, size-1, 1); else /* if size=1, just set this one bit to 1 */ - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); /* Increment the sequence by one */ - H5T_bit_inc (vector, offset, size); + H5T__bit_inc (vector, offset, size); /* Look for the one */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (size!=1 && (size_t)n!=offset+size-1) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -463,7 +463,7 @@ test_increment (void) * Look for one in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (size!=1 && n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -526,10 +526,10 @@ test_decrement (void) memset (vector, 0x00, sizeof vector); /* decrement the sequence by one */ - H5T_bit_dec (vector, offset, size); + H5T__bit_dec (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -541,7 +541,7 @@ test_decrement (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -598,10 +598,10 @@ test_negate (void) memset (vector, 0x00, sizeof vector); /* negate the sequence */ - H5T_bit_neg (vector, offset, size); + H5T__bit_neg (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if ((size_t)n!=offset) { H5_FAILED(); printf (" Unable to find first bit in destination " @@ -613,7 +613,7 @@ test_negate (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n!=(ssize_t)(offset+size-1)) { H5_FAILED(); printf (" Unable to find last bit in destination " @@ -623,13 +623,13 @@ test_negate (void) /* All-one sequence will become 000000(size=6) after negating */ memset (vector, 0x00, sizeof vector); - H5T_bit_set (vector, offset, size, 1); + H5T__bit_set (vector, offset, size, 1); /* negate the sequence */ - H5T_bit_neg (vector, offset, size); + H5T__bit_neg (vector, offset, size); /* Look for the ones */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_LSB, 1); if (n>=0) { H5_FAILED(); printf (" Unable to verify all-zero bits in destination " @@ -641,7 +641,7 @@ test_negate (void) * Look for ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); + n = H5T__bit_find (vector, (size_t)0, 8*sizeof(vector), H5T_BIT_MSB, 1); if (n>=0) { H5_FAILED(); printf (" Unable to verify all-zero bits in destination " @@ -695,7 +695,7 @@ test_set (void) memset (v2, 0x00, sizeof v2); /* Set some bits in v2 */ - H5T_bit_set (v2, d_offset, size, TRUE); + H5T__bit_set (v2, d_offset, size, TRUE); for (j=0; j<(int)sizeof(v2); j++) if (v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -710,7 +710,7 @@ test_set (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 1); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first set bit in destination " @@ -722,7 +722,7 @@ test_set (void) puts (" Found set bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 0); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last set bit in destination " @@ -739,7 +739,7 @@ test_set (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 1); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last set bit in destination " @@ -751,7 +751,7 @@ test_set (void) puts (" Found set bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 0); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of set bit region " @@ -812,7 +812,7 @@ test_clear (void) memset (v2, 0xff, sizeof v2); /* Clear some bits in v2 */ - H5T_bit_set (v2, d_offset, size, FALSE); + H5T__bit_set (v2, d_offset, size, FALSE); for (j=0; j<(int)sizeof(v2); j++) if (0xff!=v2[j]) break; if (size>0 && j>=(int)sizeof(v2)) { H5_FAILED(); @@ -827,7 +827,7 @@ test_clear (void) /* Look for the zeros and ones */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_LSB, 0); if (size>0 && n!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find first cleared bit in destination " @@ -839,7 +839,7 @@ test_clear (void) puts (" Found cleared bits and shouldn't have!"); goto failed; } - n = H5T_bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1); + n = H5T__bit_find (v2, d_offset, 8*sizeof(v2)-d_offset, H5T_BIT_LSB, 1); if (d_offset+size<8*sizeof(v2) && n!=(ssize_t)size) { H5_FAILED(); printf (" Unable to find last cleared bit in destination " @@ -856,7 +856,7 @@ test_clear (void) * Look for zeros and ones in reverse order. This is only to test * that reverse searches work as expected. */ - n = H5T_bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0); + n = H5T__bit_find (v2, (size_t)0, 8*sizeof(v2), H5T_BIT_MSB, 0); if (size>0 && (size_t)(n+1)!=d_offset+size) { H5_FAILED(); printf (" Unable to find last cleared bit in destination " @@ -868,7 +868,7 @@ test_clear (void) puts (" Found cleared bits but shouldn't have (reverse)!"); goto failed; } - n = H5T_bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1); + n = H5T__bit_find (v2, (size_t)0, d_offset+size, H5T_BIT_MSB, 1); if (d_offset>0 && n+1!=(ssize_t)d_offset) { H5_FAILED(); printf (" Unable to find beginning of cleared bit region " diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index d7f7842..433c488 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2183,7 +2183,7 @@ main (int argc, char *argv[]) fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); exit(1); } - H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T_conv_struct_opt); + H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T__conv_struct_opt); } /* Create the file */ diff --git a/test/dt_arith.c b/test/dt_arith.c index 054f069..0001755 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -306,9 +306,9 @@ static int without_hardware_g = 0; *00000111,..., until 11111111.*/ \ memset(tmp1, 0, SRC_SIZE); \ memset(tmp2, 0, SRC_SIZE); \ - H5T_bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \ + H5T__bit_set (tmp2, SRC_PREC-1, (size_t)1, TRUE); /*the negative value*/ \ for(n=0; ndst_nbits) { - if(0==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits), + if(0==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits), H5T_BIT_MSB, 1)>=0) { /* * Source is positive and the magnitude is too large for * the destination. The destination should be set to the * maximum possible value: 0x7f...f */ - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ - } else if (1==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && - H5T_bit_find(src_bits, (size_t)0, src_nbits-1, H5T_BIT_MSB, + } else if (1==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && + H5T__bit_find(src_bits, (size_t)0, src_nbits-1, H5T_BIT_MSB, 0)+1>=(ssize_t)dst_nbits) { /* * Source is negative but the magnitude is too large for * the destination. The destination should be set to the * smallest possible value: 0x80...0 */ - if (1==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) + if (1==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } } else if(src_nbitsdst_nbits && - H5T_bit_find(src_bits, dst_nbits-1, + H5T__bit_find(src_bits, dst_nbits-1, src_nbits-dst_nbits, H5T_BIT_LSB, 1)>=0) { /* * The source is a value with a magnitude too large for * the destination. The destination should be the * largest possible value: 0xff...f */ - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } else if (H5T_SGN_NONE==src_sign && H5T_SGN_2==dst_sign) { if (src_nbits>=dst_nbits && - H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits)+1, + H5T__bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits)+1, H5T_BIT_LSB, 1)>=0) { /* * The source value has a magnitude that is larger than * the destination can handle. The destination should be * set to the largest possible positive value: 0x7f...f */ - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } else { if (src_nbits>dst_nbits && - H5T_bit_find(src_bits, dst_nbits, src_nbits-dst_nbits, + H5T__bit_find(src_bits, dst_nbits, src_nbits-dst_nbits, H5T_BIT_LSB, 1)>=0) { /* * The unsigned source has a value which is too large for * the unsigned destination. The destination should be * set to the largest possible value: 0xff...f */ - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } } @@ -2610,8 +2610,8 @@ error: /*------------------------------------------------------------------------- * Function: test_conv_int_2 * - * Purpose: Tests overlap calculates in H5T_conv_i_i(), which should be - * the same as for H5T_conv_f_f() and H5T_conv_s_s(). + * Purpose: Tests overlap calculates in H5T__conv_i_i(), which should be + * the same as for H5T__conv_f_f() and H5T__conv_s_s(). * * Return: Success: 0 * @@ -2648,7 +2648,7 @@ test_conv_int_2(void) /* * Conversion. If overlap calculations aren't right then an - * assertion will fail in H5T_conv_i_i() + * assertion will fail in H5T__conv_i_i() */ H5Tconvert(src_type, dst_type, (size_t)100, buf, NULL, H5P_DEFAULT); H5Tclose(src_type); @@ -2788,8 +2788,8 @@ my_isinf(int endian, unsigned char *val, size_t size, bits[size-(i+1)] = *(val + ENDIAN(size, i, endian)); #endif /*H5_VMS*/ - if(H5T_bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && - H5T_bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) + if(H5T__bit_find(bits, mpos, msize, H5T_BIT_LSB, 1) < 0 && + H5T__bit_find(bits, epos, esize, H5T_BIT_LSB, 0) < 0) retval = 1; free(bits); @@ -3321,7 +3321,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } } - expo = H5T_bit_get_d(tmp, src_epos, src_esize); + expo = H5T__bit_get_d(tmp, src_epos, src_esize); if(expo==0) continue; /* Denormalized floating-point value detected */ else { @@ -3341,7 +3341,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } } - expo = H5T_bit_get_d(tmp, dst_epos, dst_esize); + expo = H5T__bit_get_d(tmp, dst_epos, dst_esize); if(expo==0) continue; /* Denormalized floating-point value detected */ else { @@ -4348,7 +4348,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) ) && (INT_SCHAR==dst_type || INT_SHORT==dst_type || INT_INT==dst_type || INT_LONG==dst_type || INT_LLONG==dst_type)) { - if(0==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && + if(0==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && overflows(src_bits, src, dst_nbits-1)) { /* * Source is positive and the magnitude is too large for @@ -4356,15 +4356,15 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * maximum possible value: 0x7f...f */ if(!except_set) { - if (0==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) + if (0==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } else { /* fill_value is small so we know only the 1st byte is set */ if (dst_bits[0] == fill_value) continue; /*no error*/ } - } else if (1==H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1) && + } else if (1==H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1) && overflows(src_bits, src, dst_nbits-1)) { /* * Source is negative but the magnitude is too large for @@ -4372,8 +4372,8 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * smallest possible value: 0x80...0 */ if(!except_set) { - if (1==H5T_bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && - H5T_bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) + if (1==H5T__bit_get_d(dst_bits, dst_nbits-1, (size_t)1) && + H5T__bit_find(dst_bits, (size_t)0, dst_nbits-1, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4389,14 +4389,14 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) ) && (INT_UCHAR==dst_type || INT_USHORT==dst_type || INT_UINT==dst_type || INT_ULONG==dst_type || INT_ULLONG==dst_type)) { - if (H5T_bit_get_d(src_bits, src_nbits-1, (size_t)1)) { + if (H5T__bit_get_d(src_bits, src_nbits-1, (size_t)1)) { /* * The source is negative so the result should be zero. * The source is negative if the most significant bit is * set. The destination is zero if all bits are zero. */ if(!except_set) { - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 1) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4409,7 +4409,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) * largest possible value: 0xff...f */ if(!except_set) { - if (H5T_bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) + if (H5T__bit_find(dst_bits, (size_t)0, dst_nbits, H5T_BIT_LSB, 0) < 0) continue; /*no error*/ } else { if (dst_bits[0] == fill_value) @@ -4757,13 +4757,13 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) HDmemcpy(bits, origin_bits, src_prec/8+1); /*Check for special cases: +Inf, -Inf*/ - if (H5T_bit_find (bits, mpos, mant_digits, H5T_BIT_LSB, TRUE) < 0) { - if (H5T_bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { + if (H5T__bit_find (bits, mpos, mant_digits, H5T_BIT_LSB, TRUE) < 0) { + if (H5T__bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { ret_value=TRUE; goto done; } - } else if (H5T_NORM_NONE==norm && H5T_bit_find (bits, mpos, mant_digits-1, - H5T_BIT_LSB, TRUE) < 0 && H5T_bit_find (bits, epos, expt_digits, + } else if (H5T_NORM_NONE==norm && H5T__bit_find (bits, mpos, mant_digits-1, + H5T_BIT_LSB, TRUE) < 0 && H5T__bit_find (bits, epos, expt_digits, H5T_BIT_LSB, FALSE) < 0) { /*This is a special case for the source of no implied mantissa bit. *If the exponent bits are all 1s and only the 1st bit of mantissa @@ -4773,7 +4773,7 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) } /* get exponent */ - expt = H5T_bit_get_d(bits, mant_digits, expt_digits) - bias; + expt = H5T__bit_get_d(bits, mant_digits, expt_digits) - bias; if(expt>=(dst_num_bits-1)) { ret_value=TRUE; @@ -4781,19 +4781,19 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) } /* get significand */ - H5T_bit_copy (mant_bits, (size_t)0, bits, (size_t)0, mant_digits); + H5T__bit_copy (mant_bits, (size_t)0, bits, (size_t)0, mant_digits); /* restore implicit bit if normalization is implied*/ if(norm == H5T_NORM_IMPLIED) { - H5T_bit_inc(mant_bits, mant_digits, (size_t)1); + H5T__bit_inc(mant_bits, mant_digits, (size_t)1); mant_digits++; } /* shift significand */ - H5T_bit_shift (mant_bits, (ssize_t)(expt-expt_digits), (size_t)0, (size_t)(32 * 8)); + H5T__bit_shift (mant_bits, (ssize_t)(expt-expt_digits), (size_t)0, (size_t)(32 * 8)); - indx = H5T_bit_find(mant_bits, (size_t)0, (size_t)(32 * 8), H5T_BIT_MSB, 1); + indx = H5T__bit_find(mant_bits, (size_t)0, (size_t)(32 * 8), H5T_BIT_MSB, 1); if((size_t)indx>=dst_num_bits) ret_value=TRUE; diff --git a/test/external.c b/test/external.c index 1dedeab..ae1008c 100644 --- a/test/external.c +++ b/test/external.c @@ -111,6 +111,7 @@ test_1a(hid_t file) char name[256]; /*external file name */ off_t file_offset; /*external file offset */ hsize_t file_size; /*sizeof external file segment */ + haddr_t dset_addr; /*address of dataset */ TESTING("fixed-size data space, exact storage"); @@ -130,7 +131,10 @@ test_1a(hid_t file) if((dset = H5Dopen2(file, "dset1", H5P_DEFAULT)) < 0) goto error; /* Test dataset address. Should be undefined. */ - if(H5Dget_offset(dset) != HADDR_UNDEF) goto error; + H5E_BEGIN_TRY { + dset_addr = H5Dget_offset(dset); + } H5E_END_TRY; + if(dset_addr != HADDR_UNDEF) goto error; if((dcpl = H5Dget_create_plist(dset)) < 0) goto error; if((n = H5Pget_external_count(dcpl)) < 0) goto error; diff --git a/test/testfiles/error_test_1 b/test/testfiles/error_test_1 index 8d6e208..b322460 100644 --- a/test/testfiles/error_test_1 +++ b/test/testfiles/error_test_1 @@ -44,13 +44,13 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dread(): can't read data major: Dataset minor: Read failed - #001: (file name) line (number) in H5D_read(): can't read data + #001: (file name) line (number) in H5D__read(): can't read data major: Dataset minor: Read failed - #002: (file name) line (number) in H5D_chunk_read(): unable to read raw data chunk + #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk major: Low-level I/O minor: Read failed - #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed + #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed major: Data filters minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'bogus' is not registered diff --git a/test/tmisc.c b/test/tmisc.c index 5539cee..6fcf557 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -3460,14 +3460,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 3, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 3, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -3478,14 +3478,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 3, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 3, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE2_DIM0 * MISC20_SPACE2_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE2_DIM0 * MISC20_SPACE2_DIM1 * H5Tget_size(H5T_NATIVE_INT)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -3508,14 +3508,14 @@ test_misc20(void) CHECK(did, FAIL, "H5Dopen2"); /* Get the layout version */ - ret = H5D_layout_version_test(did,&version); - CHECK(ret, FAIL, "H5D_layout_version_test"); - VERIFY(version, 2, "H5D_layout_version_test"); + ret = H5D__layout_version_test(did,&version); + CHECK(ret, FAIL, "H5D__layout_version_test"); + VERIFY(version, 2, "H5D__layout_version_test"); /* Get the layout contiguous storage size */ - ret = H5D_layout_contig_size_test(did,&contig_size); - CHECK(ret, FAIL, "H5D_layout_contig_size_test"); - VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_STD_I32LE)), "H5D_layout_contig_size_test"); + ret = H5D__layout_contig_size_test(did,&contig_size); + CHECK(ret, FAIL, "H5D__layout_contig_size_test"); + VERIFY(contig_size, (MISC20_SPACE_DIM0 * MISC20_SPACE_DIM1 * H5Tget_size(H5T_STD_I32LE)), "H5D__layout_contig_size_test"); /* Close datasset */ ret = H5Dclose(did); @@ -4963,10 +4963,10 @@ test_misc28(void) CHECK(did, FAIL, "H5Dcreate2"); /* Verify that the chunk cache is empty */ - ret = H5D_current_cache_size_test(did, &nbytes_used, &nused); - CHECK(ret, FAIL, "H5D_current_cache_size_test"); - VERIFY(nbytes_used, (size_t) 0, "H5D_current_cache_size_test"); - VERIFY(nused, 0, "H5D_current_cache_size_test"); + ret = H5D__current_cache_size_test(did, &nbytes_used, &nused); + CHECK(ret, FAIL, "H5D__current_cache_size_test"); + VERIFY(nbytes_used, (size_t) 0, "H5D__current_cache_size_test"); + VERIFY(nused, 0, "H5D__current_cache_size_test"); /* Initialize write buffer */ for(i=0; iindent_level++; ctx->need_prefix = TRUE; @@ -3063,6 +3062,7 @@ h5tools_dump_dcpl(FILE *stream, const h5tool_format_t *info, h5tools_simple_prefix(stream, info, ctx, curr_pos, 0); h5tools_str_reset(&buffer); + ioffset = H5Dget_offset(obj_id); h5tools_str_append(&buffer,"OFFSET "H5_PRINTF_HADDR_FMT, ioffset); h5tools_render_element(stream, info, ctx, &buffer, &curr_pos, ncols, 0, 0); @@ -3375,7 +3375,6 @@ h5tools_dump_comment(FILE *stream, const h5tool_format_t *info, size_t buf_size = 0; size_t ncols = 80; /* available output width */ h5tools_str_t buffer; /* string into which to render */ - hsize_t elmt_counter = 0;/* counts the # elements printed.*/ hsize_t curr_pos = ctx->sm_pos; /* total data element position */ /* pass to the prefix in h5tools_simple_prefix the total position * instead of the current stripmine position i; this is necessary @@ -3429,7 +3428,6 @@ h5tools_dump_attribute(FILE *stream, const h5tool_format_t *info, { h5tools_str_t buffer; /* string into which to render */ size_t ncols = 80; /* available output width */ - hsize_t elmt_counter = 0;/* counts the # elements printed.*/ hsize_t curr_pos = ctx->sm_pos; /* total data element position */ /* pass to the prefix in h5tools_simple_prefix the total position * instead of the current stripmine position i; this is necessary diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index f24fbba..9df49cf 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -23,33 +23,34 @@ * *------------------------------------------------------------------------- */ -#define H5A_PACKAGE /*suppress error about including H5Apkg */ -#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ +#define H5A_PACKAGE /*suppress error about including H5Apkg */ +#define H5B2_PACKAGE /*suppress error about including H5B2pkg */ #define H5B2_TESTING /*suppress warning about H5B2 testing funcs*/ -#define H5EA_PACKAGE /*suppress error about including H5EApkg */ +#define H5D_PACKAGE /*suppress error about including H5Dpkg */ +#define H5EA_PACKAGE /*suppress error about including H5EApkg */ #define H5EA_TESTING /*suppress warning about H5EA testing funcs*/ -#define H5FA_PACKAGE /*suppress error about including H5FApkg */ +#define H5FA_PACKAGE /*suppress error about including H5FApkg */ #define H5FA_TESTING /*suppress warning about H5FA testing funcs*/ -#define H5F_PACKAGE /*suppress error about including H5Fpkg */ -#define H5G_PACKAGE /*suppress error about including H5Gpkg */ -#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ -#define H5O_PACKAGE /*suppress error about including H5Opkg */ -#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ - -#include "H5private.h" /* Generic Functions */ -#include "H5Apkg.h" /* Attributes */ -#include "H5B2pkg.h" /* v2 B-trees */ -#include "H5Dprivate.h" /* Datasets */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5EApkg.h" /* Extensible Arrays */ -#include "H5FApkg.h" /* Fixed Arrays */ -#include "H5Fpkg.h" /* File access */ -#include "H5FSprivate.h" /* Free space manager */ -#include "H5Gpkg.h" /* Groups */ -#include "H5HFpkg.h" /* Fractal heaps */ -#include "H5HGprivate.h" /* Global Heaps */ -#include "H5Iprivate.h" /* IDs */ -#include "H5Opkg.h" /* Object headers */ +#define H5F_PACKAGE /*suppress error about including H5Fpkg */ +#define H5G_PACKAGE /*suppress error about including H5Gpkg */ +#define H5HF_PACKAGE /*suppress error about including H5HFpkg */ +#define H5O_PACKAGE /*suppress error about including H5Opkg */ +#define H5SM_PACKAGE /*suppress error about including H5SMpkg */ + +#include "H5private.h" /* Generic Functions */ +#include "H5Apkg.h" /* Attributes */ +#include "H5B2pkg.h" /* v2 B-trees */ +#include "H5Dpkg.h" /* Datasets */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5EApkg.h" /* Extensible Arrays */ +#include "H5FApkg.h" /* Fixed Arrays */ +#include "H5Fpkg.h" /* File access */ +#include "H5FSprivate.h" /* Free space manager */ +#include "H5Gpkg.h" /* Groups */ +#include "H5HFpkg.h" /* Fractal heaps */ +#include "H5HGprivate.h" /* Global Heaps */ +#include "H5Iprivate.h" /* IDs */ +#include "H5Opkg.h" /* Object headers */ #include "H5SMpkg.h" /* Implicitly shared messages */ /* File drivers */ diff --git a/tools/testfiles/filter_fail.ddl b/tools/testfiles/filter_fail.ddl index 75534e2..1fc0506 100644 --- a/tools/testfiles/filter_fail.ddl +++ b/tools/testfiles/filter_fail.ddl @@ -12,13 +12,13 @@ HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Dread(): can't read data major: Dataset minor: Read failed - #001: (file name) line (number) in H5D_read(): can't read data + #001: (file name) line (number) in H5D__read(): can't read data major: Dataset minor: Read failed - #002: (file name) line (number) in H5D_chunk_read(): unable to read raw data chunk + #002: (file name) line (number) in H5D__chunk_read(): unable to read raw data chunk major: Low-level I/O minor: Read failed - #003: (file name) line (number) in H5D_chunk_lock(): data pipeline read failed + #003: (file name) line (number) in H5D__chunk_lock(): data pipeline read failed major: Data filters minor: Filter operation failed #004: (file name) line (number) in H5Z_pipeline(): required filter 'filter_fail_test' is not registered -- cgit v0.12 From 41b9ce962af276c0bca218dcf8eceb0726f9c4cb Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 19 Apr 2012 16:38:07 -0500 Subject: [svn-r22300] Purpose: Fix for HDFFV-8001 - h5unjam: segfault when used -V (show version) option Description: h5unjam has an option '-V' to display version information. "h5unjam -V" caused segfulat for 1.8.9 pre-release. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- release_docs/RELEASE.txt | 2 ++ tools/h5jam/h5unjam.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 948eb2b..88ac2ba 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -696,6 +696,8 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5unjam: Fixed sefgault when used -V (show version) option. + HDFFV-8001 (JKM 2012/04/19) - h5repack: Fixed a failure when change the chunk size of a specified chunked dataset with unlimited max dims. HDFFV-7993 (JKM 2012/04/11) - h5diff: Fixed failure for comparing same named object with different diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 4751dad..c304045 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -243,6 +243,9 @@ main(int argc, const char *argv[]) H5Eget_auto2(H5E_DEFAULT, &func, &edata); H5Eset_auto2(H5E_DEFAULT, NULL, NULL); + /* Initialize h5tools lib */ + h5tools_init(); + parse_command_line(argc, argv); if (input_file == NULL) { -- cgit v0.12 From 3d90128b169a23fd69f9d8dd603e67819333da5e Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 22 Apr 2012 09:35:32 -0500 Subject: [svn-r22311] Snapshot version 1.9 release 115 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 397c6d3..1da56bc 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.115 currently under development +HDF5 version 1.9.116 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index aa50847..b03302d 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 6c3ac83..5efb10a 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index ef7ff7b..9338e3f 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22257 2012-04-08 14:40:16Z hdftest . +# From configure.in Id: configure.in 22286 2012-04-15 14:36:51Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.115. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.116. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.115' -PACKAGE_STRING='HDF5 1.9.115' +PACKAGE_VERSION='1.9.116' +PACKAGE_STRING='HDF5 1.9.116' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.115 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.116 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.115:";; + short | recursive ) echo "Configuration of HDF5 1.9.116:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.115 +HDF5 configure 1.9.116 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.115, which was +It was created by HDF5 $as_me 1.9.116, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.115' + VERSION='1.9.116' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.115, which was +This file was extended by HDF5 $as_me 1.9.116, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.115 +HDF5 config.status 1.9.116 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.115 +HDF5 config.lt 1.9.116 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index c0ad348..7a583b5 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.115], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.116], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 3318c14..83c5b67 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index f89a5ea..aa4753c 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index dd1f061..3a0e024 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2509c94..94861a0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 88ac2ba..87e1c56 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.115 currently under development +HDF5 version 1.9.116 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index d9a7658..79090bc 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 115 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 116 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.115" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.116" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index a169b1c..c93aa6d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 105 +LT_VERS_REVISION = 106 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 4013128..9bf3e0c 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.115" +#define H5_PACKAGE_STRING "HDF5 1.9.116" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.115" +#define H5_PACKAGE_VERSION "1.9.116" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.115" +#define H5_VERSION "1.9.116" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 063f8ef..ddd3344 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.115" +#define H5_PACKAGE_STRING "HDF5 1.9.116" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.115" +#define H5_PACKAGE_VERSION "1.9.116" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.115" +#define H5_VERSION "1.9.116" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 447d13e82bd4901b42cabf1580c889b29d5f906b Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 23 Apr 2012 14:21:23 -0500 Subject: [svn-r22312] Description: Correct error reported by user (Martin Otte) where we weren't using realloc'ed buffer in MPI datatype code. Tested on: Mac OSX/64 10.7.3 (amazon) w/parallel --- src/H5Smpio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 7cd4c31..868a00f 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -583,6 +583,7 @@ H5S_obtain_datatype(const hsize_t *down, H5S_hyper_span_t *span, blocklen = tmp_blocklen; if(NULL == (tmp_inner_type = (MPI_Datatype *)H5MM_realloc(inner_type, alloc_count * sizeof(MPI_Datatype)))) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTALLOC, FAIL, "can't allocate array of inner MPI datatypes") + inner_type = tmp_inner_type; } /* end if */ /* Displacement should be in byte and should have dimension information */ -- cgit v0.12 From 8c138d7844935a882c70f1db20c691c9a04b38af Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 26 Apr 2012 09:51:36 -0500 Subject: [svn-r22318] Use new function that combines two functions that check for vlen types. Based on code used in h5ls. Tested: local linux --- tools/h5dump/h5dump_xml.c | 4 +--- tools/lib/h5tools_dump.c | 12 +++--------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index e6f8043..0c48216 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1883,9 +1883,7 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU p_type = h5tools_get_native_type(type); /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; H5Tclose(type); diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 75f3c7e..194e85e 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -1143,9 +1143,7 @@ h5tools_print_simple_subset(FILE *stream, const h5tool_format_t *info, h5tools_c size_row_block = sset->block.data[row_dim]; /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; /* display loop */ @@ -1553,9 +1551,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5tool_format_t *info, h5tools_cont } /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; /* @@ -3806,9 +3802,7 @@ h5tools_dump_data(FILE *stream, const h5tool_format_t *info, ndims = H5Sget_simple_extent_dims(space, size, NULL); /* Check if we have VL data in the dataset's datatype */ - if (h5tools_detect_vlen_str(p_type) == TRUE) - vl_data = TRUE; - if (H5Tdetect_class(p_type, H5T_VLEN) == TRUE) + if (h5tools_detect_vlen(p_type) == TRUE) vl_data = TRUE; for (i = 0; i < ndims; i++) -- cgit v0.12 From 1b35c60118c2f48ee9022a667aa9ed31c191af80 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Thu, 26 Apr 2012 10:56:16 -0500 Subject: [svn-r22319] Purpose: Fix for HDFFV-7998-h5diff: incorrect behavior and output for comparing symbolic dangling links without following-symlinks option Description: Fix not to check and display dangling link status without --follow-symlinks option. Berfor the fix, when comparing symbolic link to symbolic link without follow-symlinks option, h5diff followed to check if those links are dangling or not. It caused to display output incorrectly (dangling link instead of symbolic link). The fix also improved performance when comparing lots of symbolic links without the --follow-symlinks option. Test cases were added and tagged with jira#. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE), Windows (32-LE cmake), Cmake (jam) --- MANIFEST | 5 ++++ release_docs/RELEASE.txt | 4 +++ tools/h5diff/CMakeLists.txt | 27 ++++++++++++++++++ tools/h5diff/h5diffgentest.c | 20 ++++++++++++-- tools/h5diff/testfiles/h5diff_450.txt | 3 ++ tools/h5diff/testfiles/h5diff_451.txt | 2 ++ tools/h5diff/testfiles/h5diff_471.txt | 38 ++++++++++++++++++++++++++ tools/h5diff/testfiles/h5diff_472.txt | 3 ++ tools/h5diff/testfiles/h5diff_473.txt | 3 ++ tools/h5diff/testfiles/h5diff_474.txt | 3 ++ tools/h5diff/testfiles/h5diff_475.txt | 3 ++ tools/h5diff/testfiles/h5diff_danglelinks1.h5 | Bin 5012 -> 4970 bytes tools/h5diff/testfiles/h5diff_danglelinks2.h5 | Bin 5012 -> 4970 bytes tools/h5diff/testh5diff.sh | 16 +++++++++++ tools/lib/h5diff.c | 8 +++--- 15 files changed, 129 insertions(+), 6 deletions(-) create mode 100644 tools/h5diff/testfiles/h5diff_471.txt create mode 100644 tools/h5diff/testfiles/h5diff_472.txt create mode 100644 tools/h5diff/testfiles/h5diff_473.txt create mode 100644 tools/h5diff/testfiles/h5diff_474.txt create mode 100644 tools/h5diff/testfiles/h5diff_475.txt diff --git a/MANIFEST b/MANIFEST index 48ba3d3..c098d4e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1863,6 +1863,11 @@ ./tools/h5diff/testfiles/h5diff_467.txt ./tools/h5diff/testfiles/h5diff_468.txt ./tools/h5diff/testfiles/h5diff_469.txt +./tools/h5diff/testfiles/h5diff_471.txt +./tools/h5diff/testfiles/h5diff_472.txt +./tools/h5diff/testfiles/h5diff_473.txt +./tools/h5diff/testfiles/h5diff_474.txt +./tools/h5diff/testfiles/h5diff_475.txt ./tools/h5diff/testfiles/h5diff_480.txt ./tools/h5diff/testfiles/h5diff_481.txt ./tools/h5diff/testfiles/h5diff_482.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 87e1c56..da8c83d 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -696,6 +696,10 @@ Bug Fixes since HDF5-1.8.0 release Tools ----- + - h5diff: Fixed not to check and display dangling link status without + --follow-symlinks option. This also improved performance when + comparing lots of external links without the --follow-symlinks + option. HDFFV-7998 (JKM 2012/04/26) - h5unjam: Fixed sefgault when used -V (show version) option. HDFFV-8001 (JKM 2012/04/19) - h5repack: Fixed a failure when change the chunk size of a specified diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index da2aaf9..4ac4477 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -136,6 +136,11 @@ IF (BUILD_TESTING) h5diff_467.txt h5diff_468.txt h5diff_469.txt + h5diff_471.txt + h5diff_472.txt + h5diff_473.txt + h5diff_474.txt + h5diff_475.txt h5diff_480.txt h5diff_481.txt h5diff_482.txt @@ -683,6 +688,16 @@ IF (BUILD_TESTING) h5diff_468.out.err h5diff_469.out h5diff_469.out.err + h5diff_471.out + h5diff_471.out.err + h5diff_472.out + h5diff_472.out.err + h5diff_473.out + h5diff_473.out.err + h5diff_474.out + h5diff_474.out.err + h5diff_475.out + h5diff_475.out.err h5diff_480.out h5diff_480.out.err h5diff_481.out @@ -1309,6 +1324,18 @@ ADD_H5_TEST (h5diff_468 0 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dan # ext link vs. ext dangling ADD_H5_TEST (h5diff_469 1 -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2) +#--------------------------------------------------- +# dangling links without follow symlink +# (HDFFV-7998) +# test - soft dangle links (same and different paths), +# - external dangle links (same and different paths) +ADD_H5_TEST (h5diff_471 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5) +ADD_H5_TEST (h5diff_472 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1) +ADD_H5_TEST (h5diff_473 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4) +ADD_H5_TEST (h5diff_474 0 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4) +ADD_H5_TEST (h5diff_475 1 -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1) + + # ############################################################################## # # test for group diff recursivly # ############################################################################## diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c index 0b8b4cf..c370f79 100644 --- a/tools/h5diff/h5diffgentest.c +++ b/tools/h5diff/h5diffgentest.c @@ -2181,6 +2181,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } + status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + status = FAIL; + goto out; + } + /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) @@ -2206,6 +2214,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } + status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); + if (status < 0) + { + fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + status = FAIL; + goto out; + } + /*----------------------------------------------------------------------- * External Links *------------------------------------------------------------------------*/ @@ -2234,7 +2250,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file1.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); @@ -2267,7 +2283,7 @@ static int test_dangle_links(const char *fname1, const char *fname2) goto out; } - status = H5Lcreate_external("no_file2.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); + status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); diff --git a/tools/h5diff/testfiles/h5diff_450.txt b/tools/h5diff/testfiles/h5diff_450.txt index bf4f6e9..a63d78f 100644 --- a/tools/h5diff/testfiles/h5diff_450.txt +++ b/tools/h5diff/testfiles/h5diff_450.txt @@ -11,6 +11,7 @@ file1 file2 x x /soft_link1 x x /soft_link2 x x /soft_link3 + x x /soft_link4 group : and 0 differences found @@ -32,4 +33,6 @@ obj2 is a dangling link. 1 differences found obj1 is a dangling link. 1 differences found +dangling link: and +0 differences found EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_451.txt b/tools/h5diff/testfiles/h5diff_451.txt index 0d30023..fd0691f 100644 --- a/tools/h5diff/testfiles/h5diff_451.txt +++ b/tools/h5diff/testfiles/h5diff_451.txt @@ -11,6 +11,7 @@ file1 file2 x x /soft_link1 x x /soft_link2 x x /soft_link3 + x x /soft_link4 group : and 0 differences found @@ -25,4 +26,5 @@ Warning: is a dangling link. Warning: is a dangling link. Warning: is a dangling link. Warning: is a dangling link. +Warning: is a dangling link. EXIT CODE: 2 diff --git a/tools/h5diff/testfiles/h5diff_471.txt b/tools/h5diff/testfiles/h5diff_471.txt new file mode 100644 index 0000000..124cdd7 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_471.txt @@ -0,0 +1,38 @@ + +file1 file2 +--------------------------------------- + x x / + x x /dset1 + x x /dset2 + x x /ext_link1 + x x /ext_link2 + x x /ext_link3 + x x /ext_link4 + x x /soft_link1 + x x /soft_link2 + x x /soft_link3 + x x /soft_link4 + +group : and +0 differences found +dataset: and +0 differences found +dataset: and +0 differences found +external link: and +1 differences found +external link: and +1 differences found +external link: and +1 differences found +external link: and +0 differences found +link : and +0 differences found +link : and +1 differences found +link : and +1 differences found +link : and +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_472.txt b/tools/h5diff/testfiles/h5diff_472.txt new file mode 100644 index 0000000..57a8af4 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_472.txt @@ -0,0 +1,3 @@ +link : and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_473.txt b/tools/h5diff/testfiles/h5diff_473.txt new file mode 100644 index 0000000..4c1855d --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_473.txt @@ -0,0 +1,3 @@ +link : and +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_474.txt b/tools/h5diff/testfiles/h5diff_474.txt new file mode 100644 index 0000000..7807551 --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_474.txt @@ -0,0 +1,3 @@ +external link: and +0 differences found +EXIT CODE: 0 diff --git a/tools/h5diff/testfiles/h5diff_475.txt b/tools/h5diff/testfiles/h5diff_475.txt new file mode 100644 index 0000000..be6110e --- /dev/null +++ b/tools/h5diff/testfiles/h5diff_475.txt @@ -0,0 +1,3 @@ +external link: and +1 differences found +EXIT CODE: 1 diff --git a/tools/h5diff/testfiles/h5diff_danglelinks1.h5 b/tools/h5diff/testfiles/h5diff_danglelinks1.h5 index 8cbaac1..b8be9bc 100644 Binary files a/tools/h5diff/testfiles/h5diff_danglelinks1.h5 and b/tools/h5diff/testfiles/h5diff_danglelinks1.h5 differ diff --git a/tools/h5diff/testfiles/h5diff_danglelinks2.h5 b/tools/h5diff/testfiles/h5diff_danglelinks2.h5 index f634210..3c3907c 100644 Binary files a/tools/h5diff/testfiles/h5diff_danglelinks2.h5 and b/tools/h5diff/testfiles/h5diff_danglelinks2.h5 differ diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index dfea6f7..b4863d1 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -209,6 +209,11 @@ $SRC_H5DIFF_TESTFILES/h5diff_466.txt $SRC_H5DIFF_TESTFILES/h5diff_467.txt $SRC_H5DIFF_TESTFILES/h5diff_468.txt $SRC_H5DIFF_TESTFILES/h5diff_469.txt +$SRC_H5DIFF_TESTFILES/h5diff_471.txt +$SRC_H5DIFF_TESTFILES/h5diff_472.txt +$SRC_H5DIFF_TESTFILES/h5diff_473.txt +$SRC_H5DIFF_TESTFILES/h5diff_474.txt +$SRC_H5DIFF_TESTFILES/h5diff_475.txt $SRC_H5DIFF_TESTFILES/h5diff_480.txt $SRC_H5DIFF_TESTFILES/h5diff_481.txt $SRC_H5DIFF_TESTFILES/h5diff_482.txt @@ -970,6 +975,17 @@ TOOLTEST h5diff_468.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_dangl # ext link vs. ext dangling TOOLTEST h5diff_469.txt -v --follow-symlinks h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link2 +#---------------------------------------- +# dangling links without follow symlink +# (HDFFV-7998) +# test - soft dangle links (same and different paths), +# - external dangle links (same and different paths) +TOOLTEST h5diff_471.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 +TOOLTEST h5diff_472.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link1 +TOOLTEST h5diff_473.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /soft_link4 +TOOLTEST h5diff_474.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link4 +TOOLTEST h5diff_475.txt -v h5diff_danglelinks1.h5 h5diff_danglelinks2.h5 /ext_link1 + # ############################################################################## # # test for group diff recursivly # ############################################################################## diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 306f914..bcd63f1 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -868,8 +868,8 @@ hsize_t h5diff(const char *fname1, /* get any symbolic links info */ - l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, TRUE); - l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, TRUE); + l_ret1 = H5tools_get_symlink_info(file1_id, obj1fullname, &trg_linfo1, options->follow_links); + l_ret2 = H5tools_get_symlink_info(file2_id, obj2fullname, &trg_linfo2, options->follow_links); /*--------------------------------------------- * check for following symlinks @@ -1697,7 +1697,7 @@ hsize_t diff(hid_t file1_id, */ /* target object1 - get type and name */ - ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, TRUE); + ret = H5tools_get_symlink_info(file1_id, path1, &linkinfo1, options->follow_links); /* dangling link */ if (ret == 0) { @@ -1715,7 +1715,7 @@ hsize_t diff(hid_t file1_id, goto out; /* target object2 - get type and name */ - ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, TRUE); + ret = H5tools_get_symlink_info(file2_id, path2, &linkinfo2, options->follow_links ); /* dangling link */ if (ret == 0) { -- cgit v0.12 From b9b39067e089be2d7a7a58430cf6a95f2b150317 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Fri, 27 Apr 2012 15:37:02 -0500 Subject: [svn-r22323] Description: The ph5diff (parallel h5diff) can intermittently hang in parallel mode when comparing the two HDF5 files that contains common name objects with different object types. (HDFFV-8003) Skip only the specific test for parallel until the fix has made. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE) --- tools/h5diff/testh5diff.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index b4863d1..cb91a19 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -827,9 +827,10 @@ TOOLTEST h5diff_221.txt -c non_comparables1.h5 non_comparables2.h5 /g2 # entire file # All the comparables should display differences. -if test -n "$pmode" -a "$mydomainname" = hdfgroup.uiuc.edu; then +if test -n "$pmode"; then # parallel mode: - # skip due to ph5diff hangs on koala (linux64-LE) randomly. + # skip due to ph5diff hangs on koala (linux64-LE) and ember intermittently. + # (HDFFV-8003 - TBD) SKIP -c non_comparables1.h5 non_comparables2.h5 else TOOLTEST h5diff_222.txt -c non_comparables1.h5 non_comparables2.h5 -- cgit v0.12 From b1b8ff96bbd3c42c8b44550c7f6323240b02b223 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sun, 29 Apr 2012 00:04:39 -0500 Subject: [svn-r22324] Description: Change name of MPE log file produced from "cpilog" (which was the name used in the example code we were referencing) to "h5log". Tested on: None, too trivial, eyeballed only... --- src/H5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5.c b/src/H5.c index 654c730..4176d96 100644 --- a/src/H5.c +++ b/src/H5.c @@ -307,7 +307,7 @@ H5_term_library(void) MPI_Initialized(&mpi_initialized); if(mpi_initialized) { - mpe_code = MPE_Finish_log("cpilog"); + mpe_code = MPE_Finish_log("h5log"); assert(mpe_code >=0); } /* end if */ H5_MPEinit_g = FALSE; /* turn it off no matter what */ -- cgit v0.12 From 825a2ae17e423a2e8a6c353069750bf2b5d1d94e Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 29 Apr 2012 09:36:52 -0500 Subject: [svn-r22326] Snapshot version 1.9 release 116 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 1da56bc..8563908 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.116 currently under development +HDF5 version 1.9.117 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index b03302d..a50f03f 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 5efb10a..f4f25c8 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 9338e3f..c3ef28d 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22286 2012-04-15 14:36:51Z hdftest . +# From configure.in Id: configure.in 22311 2012-04-22 14:35:32Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.116. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.117. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.116' -PACKAGE_STRING='HDF5 1.9.116' +PACKAGE_VERSION='1.9.117' +PACKAGE_STRING='HDF5 1.9.117' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.116 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.117 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.116:";; + short | recursive ) echo "Configuration of HDF5 1.9.117:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.116 +HDF5 configure 1.9.117 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.116, which was +It was created by HDF5 $as_me 1.9.117, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.116' + VERSION='1.9.117' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.116, which was +This file was extended by HDF5 $as_me 1.9.117, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.116 +HDF5 config.status 1.9.117 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.116 +HDF5 config.lt 1.9.117 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 7a583b5..32f2dfa 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.116], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.117], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 83c5b67..f10b9d4 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index aa4753c..98f1542 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 3a0e024..3e581dc 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 94861a0..963e2d8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index da8c83d..540b57c 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.116 currently under development +HDF5 version 1.9.117 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 79090bc..7b64468 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 116 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 117 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.116" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.117" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index c93aa6d..ab3cc1b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 106 +LT_VERS_REVISION = 107 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 9bf3e0c..5d6c21b 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.116" +#define H5_PACKAGE_STRING "HDF5 1.9.117" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.116" +#define H5_PACKAGE_VERSION "1.9.117" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.116" +#define H5_VERSION "1.9.117" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index ddd3344..de43b88 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.116" +#define H5_PACKAGE_STRING "HDF5 1.9.117" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.116" +#define H5_PACKAGE_VERSION "1.9.117" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.116" +#define H5_VERSION "1.9.117" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From b285c91189e3d5a617017ecf4c854127b1dfc6c6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 7 May 2012 12:47:46 -0500 Subject: [svn-r22346] replace C++ style comments --- config/cmake/HDF5Tests.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 79741a8..9c21415 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -354,7 +354,7 @@ int main(int argc, char **argv) if (OFF_T_64 % 2147483647 != 1) return 1; - // stat breaks on SCO OpenServer + /* stat breaks on SCO OpenServer */ struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) -- cgit v0.12 From 306a2e07e15b7d30dc4d3e4d68f4d4438abd370f Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 13 May 2012 09:35:22 -0500 Subject: [svn-r22356] Snapshot version 1.9 release 117 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 8563908..18de83f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.117 currently under development +HDF5 version 1.9.118 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index a50f03f..7682156 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index f4f25c8..c75fd73 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index c3ef28d..7bb8294 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22311 2012-04-22 14:35:32Z hdftest . +# From configure.in Id: configure.in 22326 2012-04-29 14:36:52Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.117. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.118. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.117' -PACKAGE_STRING='HDF5 1.9.117' +PACKAGE_VERSION='1.9.118' +PACKAGE_STRING='HDF5 1.9.118' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.117 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.118 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.117:";; + short | recursive ) echo "Configuration of HDF5 1.9.118:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.117 +HDF5 configure 1.9.118 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.117, which was +It was created by HDF5 $as_me 1.9.118, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.117' + VERSION='1.9.118' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.117, which was +This file was extended by HDF5 $as_me 1.9.118, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.117 +HDF5 config.status 1.9.118 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.117 +HDF5 config.lt 1.9.118 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 32f2dfa..2fac9ed 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.117], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.118], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index f10b9d4..c2cbcd9 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 98f1542..0de32d8 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 3e581dc..16feef7 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 963e2d8..2a007a8 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 540b57c..e2431da 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.117 currently under development +HDF5 version 1.9.118 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 7b64468..684e50c 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 117 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 118 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.117" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.118" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index ab3cc1b..47a0ed2 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 107 +LT_VERS_REVISION = 108 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 5d6c21b..310ee81 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.117" +#define H5_PACKAGE_STRING "HDF5 1.9.118" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.117" +#define H5_PACKAGE_VERSION "1.9.118" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.117" +#define H5_VERSION "1.9.118" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index de43b88..8addece 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.117" +#define H5_PACKAGE_STRING "HDF5 1.9.118" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.117" +#define H5_PACKAGE_VERSION "1.9.118" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.117" +#define H5_VERSION "1.9.118" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From a4eb58bc332f72a9cfdb6a0625adac14f811243b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 14 May 2012 12:19:56 -0500 Subject: [svn-r22361] Change library source properties: remove "LANGUAGE C" property from headers. Add "LINKER C" property to link. Tested: local linux --- fortran/src/CMakeLists.txt | 11 +++++++---- hl/fortran/src/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index 3d1c127..cecbfb6 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -84,9 +84,6 @@ ADD_CUSTOM_COMMAND ( # f90CStub lib #----------------------------------------------------------------------------- SET (f90CStub_C_SRCS - # generated files - ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h - # normal distribution ${HDF5_F90_SRC_SOURCE_DIR}/H5f90kit.c ${HDF5_F90_SRC_SOURCE_DIR}/H5_f.c @@ -114,11 +111,17 @@ ENDIF (H5_HAVE_PARALLEL) SET_SOURCE_FILES_PROPERTIES (${f90CStub_C_SRCS} PROPERTIES LANGUAGE C) -ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS}) +SET (f90CStub_C_HDRS + # generated files + ${HDF5_F90_BINARY_DIR}/H5f90i_gen.h +) + +ADD_LIBRARY (${HDF5_F90_C_LIB_TARGET} ${LIB_TYPE} ${f90CStub_C_SRCS} ${f90CStub_C_HDRS}) TARGET_LINK_LIBRARIES (${HDF5_F90_C_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/fortran) +SET_TARGET_PROPERTIES (${HDF5_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran 2003 standard diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index 916e9e1..f01c7f8 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -24,13 +24,13 @@ SET (HDF5_HL_F90_C_SRCS SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_C_SRCS} PROPERTIES LANGUAGE C) SET (HDF5_HL_F90_HEADERS ${HDF5_HL_F90_SRC_SOURCE_DIR}/H5LTf90proto.h) -SET_SOURCE_FILES_PROPERTIES (${HDF5_HL_F90_HEADERS} PROPERTIES LANGUAGE C) ADD_LIBRARY (${HDF5_HL_F90_C_LIB_TARGET} ${LIB_TYPE} ${HDF5_HL_F90_C_SRCS} ${HDF5_HL_F90_HEADERS}) TARGET_LINK_LIBRARIES (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_F90_C_LIB_TARGET} ${HDF5_HL_LIB_TARGET}) SET_GLOBAL_VARIABLE (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_HL_F90_C_LIB_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_HL_F90_C_LIB_NAME} ${LIB_TYPE}) SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES FOLDER libraries/hl/fortran) +SET_TARGET_PROPERTIES (${HDF5_HL_F90_C_LIB_TARGET} PROPERTIES LINKER_LANGUAGE C) #----------------------------------------------------------------------------- # Fortran Modules -- cgit v0.12 From 987b0ac639da8aa0b038af5b933c79394a8c4a0b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 14 May 2012 15:09:13 -0500 Subject: [svn-r22366] Added libsettings file to packaging --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5543b48..828f089 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -864,6 +864,11 @@ CONFIGURE_FILE ( ${HDF5_RESOURCES_DIR}/libhdf5.settings.cmake.in ${HDF5_BINARY_DIR}/libhdf5.settings @ONLY ) +INSTALL ( + FILES ${HDF5_BINARY_DIR}/libhdf5.settings + DESTINATION ${HDF5_INSTALL_LIB_DIR} + COMPONENT libraries +) #----------------------------------------------------------------------------- # Add Document File(s) to CMake Install -- cgit v0.12 From 45e119b7d291e372cb9464df5f156809cdc05013 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 14 May 2012 17:36:04 -0500 Subject: [svn-r22368] change file name case --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index c098d4e..1cbd1a5 100644 --- a/MANIFEST +++ b/MANIFEST @@ -529,7 +529,7 @@ ./release_docs/CMake.txt ./release_docs/INSTALL_parallel ./release_docs/RELEASE.txt -./release_docs/Using_CMake.txt +./release_docs/USING_CMake.txt ./src/.indent.pro _DO_NOT_DISTRIBUTE_ ./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ -- cgit v0.12 From 7e33b494054f1fd268b793fca1bdc8dcd46c4f70 Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Mon, 14 May 2012 22:12:31 -0500 Subject: [svn-r22369] Change case of filename to match file. --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 1cbd1a5..c098d4e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -529,7 +529,7 @@ ./release_docs/CMake.txt ./release_docs/INSTALL_parallel ./release_docs/RELEASE.txt -./release_docs/USING_CMake.txt +./release_docs/Using_CMake.txt ./src/.indent.pro _DO_NOT_DISTRIBUTE_ ./src/hdf5.lnt _DO_NOT_DISTRIBUTE_ -- cgit v0.12 From 6e1a85e78107d24261cc33f897619291e2456011 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 15 May 2012 12:38:36 -0500 Subject: [svn-r22371] Fix for HDFFV-7697 Minor change to error message text in H5R.c. Minor change: tested on jam --- src/H5R.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5R.c b/src/H5R.c index 65ac7da..57eab83 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -545,7 +545,7 @@ H5Rdereference2(hid_t obj_id, hid_t oapl_id, H5R_type_t ref_type, const void *_r /* Create reference */ if((ret_value = H5R_dereference(file, oapl_id, H5AC_dxpl_id, ref_type, _ref, TRUE)) < 0) - HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable dereference object") + HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, FAIL, "unable to dereference object") done: FUNC_LEAVE_API(ret_value) -- cgit v0.12 From 27535adaa934d4e2d0384428a72645c102dd88fa Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Wed, 16 May 2012 16:16:20 -0500 Subject: [svn-r22373] Purpose: Fix h5repacktst (test file generating binary) to address HDFFV-8016 h5repacktst failed in AIX 32bit mode Description: Segmentation fault occurred when h5repacktst try to generate a dataset when system memory is limited to 256MB. Add error handling to display apporiate message to exit and adjust the test dataset according to the original size which didn't causing out of memory. Tested: test was done by limit memory in csh. jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE) --- tools/h5repack/h5repacktst.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index bc94eed..4f1707b 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -3547,7 +3547,6 @@ out: * *------------------------------------------------------------------------- */ - static int write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ @@ -3811,17 +3810,23 @@ int write_dset_in(hid_t loc_id, { + hsize_t TEST_BUFSIZE = (128 * 1024 * 1024); /* 128MB */ double *dbuf; /* information to write */ size_t size; hsize_t sdims[] = {1}; - hsize_t tdims[] = {H5TOOLS_MALLOCSIZE / sizeof(double) + 1}; + hsize_t tdims[] = {TEST_BUFSIZE / sizeof(double) + 1}; unsigned u; /* allocate and initialize array data to write */ - size = ( H5TOOLS_MALLOCSIZE / sizeof(double) + 1 ) * sizeof(double); + size = ( TEST_BUFSIZE / sizeof(double) + 1 ) * sizeof(double); dbuf = (double*)malloc( size ); + if (NULL == dbuf) + { + printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 ); + goto out; + } - for( u = 0; u < H5TOOLS_MALLOCSIZE / sizeof(double) + 1; u++) + for( u = 0; u < TEST_BUFSIZE / sizeof(double) + 1; u++) dbuf[u] = u; if (make_diffs) @@ -3830,7 +3835,7 @@ int write_dset_in(hid_t loc_id, dbuf[6] = 0; } - /* create a type larger than H5TOOLS_MALLOCSIZE */ + /* create a type larger than TEST_BUFSIZE */ if ((tid = H5Tarray_create2(H5T_NATIVE_DOUBLE, 1, tdims)) < 0) goto out; size = H5Tget_size(tid); -- cgit v0.12 From 7aaa1ad2297b8e109cbff503be0cc4e73ada0871 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 18 May 2012 09:08:58 -0500 Subject: [svn-r22375] add a test to expose a memory leak when adding/removing the same property in property list multiple times. fix that bug. test with h5committest --- src/H5Pint.c | 6 +++++- test/tgenprop.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/src/H5Pint.c b/src/H5Pint.c index 46a06a0..b216ab3 100644 --- a/src/H5Pint.c +++ b/src/H5Pint.c @@ -2314,9 +2314,13 @@ H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, /* Check if the property has been deleted */ if(NULL != H5SL_search(plist->del, name)) { + char *temp_name = NULL; /* Remove the property name from the deleted property skip list */ - if(NULL == H5SL_remove(plist->del, name)) + if(NULL == (temp_name = H5SL_remove(plist->del, name))) HGOTO_ERROR(H5E_PLIST,H5E_CANTDELETE,FAIL,"can't remove property from deleted skip list") + + /* free the name of the removed property */ + H5MM_xfree(temp_name); } /* end if */ else { H5P_genclass_t *tclass; /* Temporary class pointer */ diff --git a/test/tgenprop.c b/test/tgenprop.c index 5f9a69b..3dbaa14 100644 --- a/test/tgenprop.c +++ b/test/tgenprop.c @@ -1575,6 +1575,46 @@ test_genprop_class_addprop(void) /**************************************************************** ** +** test_genprop_list_add_remove_prop(): Test adding then removing the +** same properties to a standard HDF5 property list. This is testing +** also for a memory leak that could be caused by not freeing the +** removed property resources from the property list. +** +****************************************************************/ +static void +test_genprop_list_add_remove_prop(void) +{ + hid_t pid; /* Property List ID */ + herr_t ret; /* Generic return value */ + + /* Create a dataset creation property list */ + pid = H5Pcreate(H5P_DATASET_CREATE); + CHECK(pid, FAIL, "H5Pcreate"); + + /* Insert temporary property into class (with no callbacks) */ + ret = H5Pinsert2(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK_I(ret, "H5Pinsert2"); + + /* Delete added property */ + ret = H5Premove(pid, PROP1_NAME); + CHECK_I(ret, "H5Premove"); + + /* Insert temporary property into class (with no callbacks) */ + ret = H5Pinsert2(pid, PROP1_NAME, PROP1_SIZE, PROP1_DEF_VALUE, NULL, NULL, NULL, NULL, NULL, NULL); + CHECK_I(ret, "H5Pinsert2"); + + /* Delete added property */ + ret = H5Premove(pid, PROP1_NAME); + CHECK_I(ret, "H5Premove"); + + /* Close property list */ + ret = H5Pclose(pid); + CHECK(ret, FAIL, "H5Pclose"); + +} /* end test_genprop_list_add_remove_prop() */ + +/**************************************************************** +** ** test_genprop_equal(): Test basic generic property list code. ** More tests for H5Pequal() ** @@ -1990,6 +2030,8 @@ test_genprop(void) test_genprop_list_addprop(); /* Test adding properties to HDF5 property list */ test_genprop_class_addprop(); /* Test adding properties to HDF5 property class */ + test_genprop_list_add_remove_prop(); /* Test adding and removing the same property several times to HDF5 property list */ + test_genprop_equal(); /* Tests for more H5Pequal verification */ test_genprop_path(); /* Tests for class path verification */ test_genprop_refcount(); /* Tests for class reference counting */ -- cgit v0.12 From 886039ab68cf0c9a3242fb96676c815141571d38 Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 18 May 2012 09:51:41 -0500 Subject: [svn-r22377] make the file and memory MPI datatypes as default properties in the DXPL so that we don't have to insert and remove them everytime we perform collective I/O. Test with h5committest --- src/H5Dmpio.c | 7 +------ src/H5FDmpi.c | 51 ++++----------------------------------------------- src/H5FDmpi.h | 7 ++----- src/H5Pdxpl.c | 20 +++++++++++++++++++- 4 files changed, 26 insertions(+), 59 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 45cf6a1..70eda7e 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1548,7 +1548,7 @@ H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf FUNC_ENTER_STATIC /* Pass buf type, file type to the file driver. */ - if(H5FD_mpi_setup_collective(io_info->dxpl_id, *mpi_buf_type, *mpi_file_type) < 0) + if(H5FD_mpi_setup_collective(io_info->dxpl_id, mpi_buf_type, mpi_file_type) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") plist_is_setup = TRUE; @@ -1562,11 +1562,6 @@ H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf } /* end else */ done: - /* Reset the dxpl settings */ - if(plist_is_setup) - if(H5FD_mpi_teardown_collective(io_info->dxpl_id) < 0) - HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values") - #ifdef H5D_DEBUG if(H5DEBUG(D)) HDfprintf(H5DEBUG(D),"ret_value before leaving final_collective_io=%d\n",ret_value); diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index ff2c87d..46e7ade 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -466,7 +466,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype) +H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, MPI_Datatype *ftype) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ @@ -478,56 +478,13 @@ H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, MPI_Datatype ftype) HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") /* Set buffer MPI type */ - if(H5P_insert(plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME,H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE,&btype,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_set(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, btype) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property") - /* Set file MPI type */ - if(H5P_insert(plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME,H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE,&ftype,NULL,NULL,NULL,NULL,NULL,NULL)<0) + /* Set File MPI type */ + if(H5P_set(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, ftype) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't insert MPI-I/O property") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpi_setup_collective() */ - - -/*------------------------------------------------------------------------- - * Function: H5FD_mpi_teardown_collective - * - * Purpose: Remove the temporary MPI-I/O properties from dxpl. - * - * Return: Success: Non-negative - * Failure: Negative - * - * Programmer: Quincey Koziol - * Monday, June 17, 2002 - * - * Modifications: - * - *------------------------------------------------------------------------- - */ -herr_t -H5FD_mpi_teardown_collective(hid_t dxpl_id) -{ - H5P_genplist_t *plist; /* Property list pointer */ - herr_t ret_value=SUCCEED; /* Return value */ - - FUNC_ENTER_NOAPI(FAIL) - - /* Check arguments */ - if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) - HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, FAIL, "not a dataset transfer list") - - /* Remove buffer MPI type */ - if(H5P_remove(dxpl_id,plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property") - - /* Remove file MPI type */ - if(H5P_remove(dxpl_id,plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME)<0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTDELETE, FAIL, "can't remove MPI-I/O property") - -done: - FUNC_LEAVE_NOAPI(ret_value) -} /* end H5FD_mpi_teardown_collective() */ - -#endif /* H5_HAVE_PARALLEL */ - diff --git a/src/H5FDmpi.h b/src/H5FDmpi.h index 2b7ac98..4140671 100644 --- a/src/H5FDmpi.h +++ b/src/H5FDmpi.h @@ -77,10 +77,8 @@ typedef struct H5FD_class_mpi_t { /* ======== Temporary data transfer properties ======== */ /* Definitions for memory MPI type property */ #define H5FD_MPI_XFER_MEM_MPI_TYPE_NAME "H5FD_mpi_mem_mpi_type" -#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype) /* Definitions for file MPI type property */ #define H5FD_MPI_XFER_FILE_MPI_TYPE_NAME "H5FD_mpi_file_mpi_type" -#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype) /* * The view is set to this value @@ -101,9 +99,8 @@ H5_DLL herr_t H5FD_mpi_comm_info_free(MPI_Comm *comm, MPI_Info *info); H5_DLL herr_t H5FD_mpio_wait_for_left_neighbor(H5FD_t *file); H5_DLL herr_t H5FD_mpio_signal_right_neighbor(H5FD_t *file); #endif /* NOT_YET */ -H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype btype, - MPI_Datatype ftype); -H5_DLL herr_t H5FD_mpi_teardown_collective(hid_t dxpl_id); +H5_DLL herr_t H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, + MPI_Datatype *ftype); /* Driver specific methods */ H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index c4ca95b..a4fc749 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -121,7 +121,12 @@ #define H5D_XFER_XFORM_DEL H5P_dxfr_xform_del #define H5D_XFER_XFORM_COPY H5P_dxfr_xform_copy #define H5D_XFER_XFORM_CLOSE H5P_dxfr_xform_close - +/* Definitions for memory MPI type property */ +#define H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE sizeof(MPI_Datatype) +#define H5FD_MPI_XFER_MEM_MPI_TYPE_DEF MPI_DATATYPE_NULL +/* Definitions for file MPI type property */ +#define H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE sizeof(MPI_Datatype) +#define H5FD_MPI_XFER_FILE_MPI_TYPE_DEF MPI_DATATYPE_NULL /******************/ /* Local Typedefs */ @@ -210,6 +215,8 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) unsigned def_mpio_chunk_opt_ratio = H5D_XFER_MPIO_CHUNK_OPT_RATIO_DEF; H5D_mpio_actual_chunk_opt_mode_t def_mpio_actual_chunk_opt_mode = H5D_MPIO_ACTUAL_CHUNK_OPT_MODE_DEF; H5D_mpio_actual_io_mode_t def_mpio_actual_io_mode = H5D_MPIO_ACTUAL_IO_MODE_DEF; + MPI_Datatype btype = H5FD_MPI_XFER_MEM_MPI_TYPE_DEF; /* Default value for MPI buffer type */ + MPI_Datatype ftype = H5FD_MPI_XFER_FILE_MPI_TYPE_DEF; /* Default value for MPI file type */ #endif /* H5_HAVE_PARALLEL */ H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; /* Default value for EDC property */ H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; /* Default value for filter callback */ @@ -291,6 +298,17 @@ H5P_dxfr_reg_prop(H5P_genclass_t *pclass) /* Register the actual io mode property. */ if(H5P_register_real(pclass, H5D_MPIO_ACTUAL_IO_MODE_NAME, H5D_MPIO_ACTUAL_IO_MODE_SIZE, &def_mpio_actual_io_mode, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the MPI memory type property */ + if(H5P_register_real(pclass, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, H5FD_MPI_XFER_MEM_MPI_TYPE_SIZE, + &btype, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + + /* Register the MPI file type property */ + if(H5P_register_real(pclass, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, H5FD_MPI_XFER_FILE_MPI_TYPE_SIZE, + &ftype, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") + #endif /* H5_HAVE_PARALLEL */ /* Register the EDC property */ -- cgit v0.12 From b247ef2d8948f29d37f93b9cfc60683c98bceeda Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Fri, 18 May 2012 10:01:41 -0500 Subject: [svn-r22378] removed the parallel #endif by mistake.. oops remove an un-needed bool --- src/H5Dmpio.c | 2 -- src/H5FDmpi.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 70eda7e..9b8fa27 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -1542,7 +1542,6 @@ static herr_t H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_info, hsize_t mpi_buf_count, MPI_Datatype *mpi_file_type, MPI_Datatype *mpi_buf_type) { - hbool_t plist_is_setup = FALSE; /* Whether the dxpl has been customized */ herr_t ret_value = SUCCEED; FUNC_ENTER_STATIC @@ -1550,7 +1549,6 @@ H5D__final_collective_io(H5D_io_info_t *io_info, const H5D_type_info_t *type_inf /* Pass buf type, file type to the file driver. */ if(H5FD_mpi_setup_collective(io_info->dxpl_id, mpi_buf_type, mpi_file_type) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") - plist_is_setup = TRUE; if(io_info->op_type == H5D_IO_OP_WRITE) { if((io_info->io_ops.single_write)(io_info, type_info, mpi_buf_count, NULL, NULL) < 0) diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 46e7ade..afc5536 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -488,3 +488,5 @@ H5FD_mpi_setup_collective(hid_t dxpl_id, MPI_Datatype *btype, MPI_Datatype *ftyp done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5FD_mpi_setup_collective() */ + +#endif /* H5_HAVE_PARALLEL */ -- cgit v0.12 From 823e63252bfb33802e582199a72574095a1ca8f1 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 20 May 2012 09:36:03 -0500 Subject: [svn-r22382] Snapshot version 1.9 release 118 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 18de83f..837fda3 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.118 currently under development +HDF5 version 1.9.119 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 7682156..60d0140 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index c75fd73..2f415fc 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 7bb8294..ea71496 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22326 2012-04-29 14:36:52Z hdftest . +# From configure.in Id: configure.in 22356 2012-05-13 14:35:22Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.118. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.119. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.118' -PACKAGE_STRING='HDF5 1.9.118' +PACKAGE_VERSION='1.9.119' +PACKAGE_STRING='HDF5 1.9.119' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.118 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.119 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.118:";; + short | recursive ) echo "Configuration of HDF5 1.9.119:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.118 +HDF5 configure 1.9.119 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.118, which was +It was created by HDF5 $as_me 1.9.119, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.118' + VERSION='1.9.119' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.118, which was +This file was extended by HDF5 $as_me 1.9.119, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.118 +HDF5 config.status 1.9.119 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33455,7 +33455,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.118 +HDF5 config.lt 1.9.119 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 2fac9ed..65ed544 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.118], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.119], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index c2cbcd9..f1a8077 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 0de32d8..ed2ea4e 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 16feef7..5e435a2 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 2a007a8..4396a50 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e2431da..c0eb5dc 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.118 currently under development +HDF5 version 1.9.119 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 684e50c..d000650 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 118 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 119 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.118" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.119" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 47a0ed2..b4d0465 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 108 +LT_VERS_REVISION = 109 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 310ee81..2204937 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.118" +#define H5_PACKAGE_STRING "HDF5 1.9.119" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.118" +#define H5_PACKAGE_VERSION "1.9.119" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.118" +#define H5_VERSION "1.9.119" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 8addece..8b2ee0f 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.118" +#define H5_PACKAGE_STRING "HDF5 1.9.119" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.118" +#define H5_PACKAGE_VERSION "1.9.119" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.118" +#define H5_VERSION "1.9.119" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 5e388aa2573c0ded711c5c86014244d3cd986528 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 May 2012 15:37:19 -0500 Subject: [svn-r22385] Skip tests using sparse file writes on Windows. JIRA issue (JIRA HDDFV-8064) created. --- testpar/t_mpi.c | 6 +++++- testpar/testphdf5.c | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 6cba5af..2644d63 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -1178,13 +1178,17 @@ main(int argc, char **argv) * MPIO MPIO File size range test *=======================================*/ MPI_BANNER("MPIO File size range test..."); +#ifndef H5_HAVE_WIN32_API ret_code = test_mpio_gb_file(filenames[0]); ret_code = errors_sum(ret_code); if (mpi_rank==0 && ret_code > 0){ printf("***FAILED with %d total errors\n", ret_code); nerrors += ret_code; } - +#else + if (mpi_rank==0) { + printf(" will be skipped on Windows (JIRA HDDFV-8064)\n"); +#endif /*======================================= * MPIO independent overlapping writes diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 3a86642..f27d09b 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -412,8 +412,12 @@ int main(int argc, char **argv) "collective group and dataset write", &collngroups_params); AddTest("ingrpr", independent_group_read, NULL, "independent group and dataset read", &collngroups_params); +#ifndef H5_HAVE_WIN32_API AddTest("bigdset", big_dataset, NULL, "big dataset test", PARATESTFILE); +#else + printf("big dataset test will be skipped on Windows (JIRA HDDFV-8064)\n"); +#endif AddTest("fill", dataset_fillvalue, NULL, "dataset fill value", PARATESTFILE); -- cgit v0.12 From 56d35fd9696f379a9ce65bfe7c3b07d9bfeb1aa3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 21 May 2012 16:32:21 -0500 Subject: [svn-r22386] Add missing H5_VERS_SUBRELEASE of version info --- CMakeLists.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 828f089..5b9c2a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,8 @@ STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_MINOR[ \t]+([0-9]*).*$" "\\1" H5_VERS_MINOR ${_h5public_h_contents}) STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_RELEASE[ \t]+([0-9]*).*$" "\\1" H5_VERS_RELEASE ${_h5public_h_contents}) +STRING (REGEX REPLACE ".*#define[ \t]+H5_VERS_SUBRELEASE[ \t]+\"([0-9A-Za-z.]*)\".*$" + "\\1" H5_VERS_SUBRELEASE ${_h5public_h_contents}) #MESSAGE (STATUS "VERSION: ${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}-${H5_VERS_SUBRELEASE}") #----------------------------------------------------------------------------- @@ -437,6 +439,19 @@ IF (CMAKE_COMPILER_IS_GNUCXX) ENDIF (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- +# Use gcc visibility flag. +#----------------------------------------------------------------------------- +OPTION (HDF5_ENABLE_VISIBILITY "Enable gcc4 visibility=hidden for Libraries and Programs" OFF) +IF (HDF5_ENABLE_VISIBILITY) + IF (CMAKE_COMPILER_IS_GNUCC) + SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") + ENDIF (CMAKE_COMPILER_IS_GNUCC) + IF (CMAKE_COMPILER_IS_GNUCXX) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") + ENDIF (CMAKE_COMPILER_IS_GNUCXX) +ENDIF (HDF5_ENABLE_VISIBILITY) + +#----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR}) -- cgit v0.12 From 0cbde329bd1dcf82c909f16bf49929a437c608a2 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 May 2012 09:03:43 -0500 Subject: [svn-r22388] remove unbalanced bracket --- testpar/t_mpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 2644d63..fa9cf9d 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -1186,7 +1186,7 @@ main(int argc, char **argv) nerrors += ret_code; } #else - if (mpi_rank==0) { + if (mpi_rank==0) printf(" will be skipped on Windows (JIRA HDDFV-8064)\n"); #endif -- cgit v0.12 From 2f8b5057c1613f02e3ba24aa2511734e5ea836bd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 May 2012 15:34:34 -0500 Subject: [svn-r22390] Break out the packed bits tests into a new script. reconfigure on jam Tested: local linux --- MANIFEST | 1 + configure | 5 +- configure.in | 1 + tools/h5dump/Makefile.am | 2 +- tools/h5dump/Makefile.in | 12 +- tools/h5dump/testh5dump.sh.in | 224 ----------------- tools/h5dump/testh5dumppbits.sh.in | 495 +++++++++++++++++++++++++++++++++++++ tools/h5dump/testh5dumpxml.sh.in | 171 ++++++++++++- 8 files changed, 678 insertions(+), 233 deletions(-) create mode 100644 tools/h5dump/testh5dumppbits.sh.in diff --git a/MANIFEST b/MANIFEST index c098d4e..ea78fc3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1119,6 +1119,7 @@ ./tools/h5dump/h5dump_xml.h ./tools/h5dump/h5dumpgentest.c ./tools/h5dump/testh5dump.sh.in +./tools/h5dump/testh5dumppbits.sh.in ./tools/h5dump/testh5dumpxml.sh.in ./tools/h5dump/binread.c diff --git a/configure b/configure index ea71496..984fcf3 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22356 2012-05-13 14:35:22Z hdftest . +# From configure.in Id: configure.in 22382 2012-05-20 14:36:03Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.119. # @@ -30001,7 +30001,7 @@ if test -n "$TESTPARALLEL"; then fi fi -ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" +ac_config_files="$ac_config_files src/libhdf5.settings Makefile src/Makefile test/Makefile test/testcheck_version.sh test/testerror.sh test/H5srcdir_str.h test/testlibinfo.sh test/testlinks_env.sh testpar/Makefile testpar/testph5.sh perform/Makefile tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile tools/h5diff/Makefile tools/h5jam/Makefile tools/h5jam/testh5jam.sh tools/h5repack/Makefile tools/h5repack/h5repack.sh tools/h5ls/Makefile tools/h5copy/Makefile tools/lib/Makefile tools/misc/Makefile tools/misc/h5cc tools/misc/testh5repart.sh tools/h5stat/testh5stat.sh tools/h5stat/Makefile examples/Makefile examples/run-c-ex.sh examples/testh5cc.sh c++/Makefile c++/src/Makefile c++/src/h5c++ c++/test/Makefile c++/test/H5srcdir_str.h c++/examples/Makefile c++/examples/run-c++-ex.sh c++/examples/testh5c++.sh fortran/Makefile fortran/src/h5fc fortran/src/Makefile fortran/test/Makefile fortran/testpar/Makefile fortran/examples/Makefile fortran/examples/run-fortran-ex.sh fortran/examples/testh5fc.sh hl/Makefile hl/src/Makefile hl/test/Makefile hl/test/H5srcdir_str.h hl/tools/Makefile hl/tools/gif2h5/Makefile hl/examples/Makefile hl/examples/run-hlc-ex.sh hl/c++/Makefile hl/c++/src/Makefile hl/c++/test/Makefile hl/c++/examples/Makefile hl/c++/examples/run-hlc++-ex.sh hl/fortran/Makefile hl/fortran/src/Makefile hl/fortran/test/Makefile hl/fortran/examples/Makefile hl/fortran/examples/run-hlfortran-ex.sh" cat >confcache <<\_ACEOF @@ -31277,6 +31277,7 @@ do "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "tools/h5dump/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5dump/Makefile" ;; "tools/h5dump/testh5dump.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dump.sh" ;; + "tools/h5dump/testh5dumppbits.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumppbits.sh" ;; "tools/h5dump/testh5dumpxml.sh") CONFIG_FILES="$CONFIG_FILES tools/h5dump/testh5dumpxml.sh" ;; "tools/h5ls/testh5ls.sh") CONFIG_FILES="$CONFIG_FILES tools/h5ls/testh5ls.sh" ;; "tools/h5import/Makefile") CONFIG_FILES="$CONFIG_FILES tools/h5import/Makefile" ;; diff --git a/configure.in b/configure.in index 65ed544..dba6f30 100644 --- a/configure.in +++ b/configure.in @@ -4388,6 +4388,7 @@ AC_CONFIG_FILES([src/libhdf5.settings tools/Makefile tools/h5dump/Makefile tools/h5dump/testh5dump.sh + tools/h5dump/testh5dumppbits.sh tools/h5dump/testh5dumpxml.sh tools/h5ls/testh5ls.sh tools/h5import/Makefile diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 97d81c2..38864f5 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -25,7 +25,7 @@ INCLUDES=-I$(top_srcdir)/src -I$(top_srcdir)/tools/lib # Test programs and scripts TEST_PROG=h5dumpgentest -TEST_SCRIPT=testh5dump.sh testh5dumpxml.sh +TEST_SCRIPT=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh check_PROGRAMS=$(TEST_PROG) binread check_SCRIPTS=$(TEST_SCRIPT) diff --git a/tools/h5dump/Makefile.in b/tools/h5dump/Makefile.in index 9d46557..0c45a72 100644 --- a/tools/h5dump/Makefile.in +++ b/tools/h5dump/Makefile.in @@ -52,8 +52,8 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(srcdir)/testh5dump.sh.in $(srcdir)/testh5dumpxml.sh.in \ - $(top_srcdir)/config/commence.am \ + $(srcdir)/testh5dump.sh.in $(srcdir)/testh5dumppbits.sh.in \ + $(srcdir)/testh5dumpxml.sh.in $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am check_PROGRAMS = $(am__EXEEXT_1) binread$(EXEEXT) bin_PROGRAMS = h5dump$(EXEEXT) @@ -65,7 +65,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/bin/mkinstalldirs CONFIG_HEADER = $(top_builddir)/src/H5config.h -CONFIG_CLEAN_FILES = testh5dump.sh testh5dumpxml.sh +CONFIG_CLEAN_FILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" am__EXEEXT_1 = h5dumpgentest$(EXEEXT) @@ -412,7 +412,7 @@ INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib # Test programs and scripts TEST_PROG = h5dumpgentest -TEST_SCRIPT = testh5dump.sh testh5dumpxml.sh +TEST_SCRIPT = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh check_SCRIPTS = $(TEST_SCRIPT) SCRIPT_DEPEND = h5dump$(EXEEXT) @@ -424,7 +424,7 @@ LDADD = $(LIBH5TOOLS) $(LIBHDF5) # Source files for the program h5dump_SOURCES = h5dump.c h5dump_ddl.c h5dump_xml.c -DISTCLEANFILES = testh5dump.sh +DISTCLEANFILES = testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh # Automake needs to be taught how to build lib, progs, and tests targets. # These will be filled in automatically for the most part (e.g., @@ -477,6 +477,8 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__aclocal_m4_deps): testh5dump.sh: $(top_builddir)/config.status $(srcdir)/testh5dump.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +testh5dumppbits.sh: $(top_builddir)/config.status $(srcdir)/testh5dumppbits.sh.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ testh5dumpxml.sh: $(top_builddir)/config.status $(srcdir)/testh5dumpxml.sh.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 25a30c5..5441e25 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -290,152 +290,9 @@ $SRC_H5DUMP_TESTFILES/tvlstr.ddl $SRC_H5DUMP_TESTFILES/tvms.ddl $SRC_H5DUMP_TESTFILES/h5dump-help.txt $SRC_H5DUMP_TESTFILES/out3.h5import -$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl -$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl -$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl -$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl -$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl -$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl -$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl $SRC_H5DUMP_TESTFILES/tbinregR.exp " -LIST_HDF5_TEST_FILES_XML=" -$SRC_H5DUMP_TESTFILES/tbitfields.h5 -$SRC_H5DUMP_TESTFILES/tcompound2.h5 -$SRC_H5DUMP_TESTFILES/tdset2.h5 -$SRC_H5DUMP_TESTFILES/tenum.h5 -$SRC_H5DUMP_TESTFILES/textlink.h5 -$SRC_H5DUMP_TESTFILES/tloop2.h5 -$SRC_H5DUMP_TESTFILES/tmany.h5 -$SRC_H5DUMP_TESTFILES/tname-amp.h5 -$SRC_H5DUMP_TESTFILES/tname-apos.h5 -$SRC_H5DUMP_TESTFILES/tname-gt.h5 -$SRC_H5DUMP_TESTFILES/tname-lt.h5 -$SRC_H5DUMP_TESTFILES/tname-quot.h5 -$SRC_H5DUMP_TESTFILES/tname-sp.h5 -$SRC_H5DUMP_TESTFILES/tnodata.h5 -$SRC_H5DUMP_TESTFILES/tobjref.h5 -$SRC_H5DUMP_TESTFILES/topaque.h5 -$SRC_H5DUMP_TESTFILES/tref.h5 -$SRC_H5DUMP_TESTFILES/tref-escapes.h5 -$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5 -$SRC_H5DUMP_TESTFILES/tstring.h5 -$SRC_H5DUMP_TESTFILES/tstring-at.h5 -" - -LIST_OTHER_TEST_FILES_XML=" -$SRC_H5DUMP_TESTFILES/tall.h5.xml -$SRC_H5DUMP_TESTFILES/tall-2A.h5.xml -$SRC_H5DUMP_TESTFILES/tarray1.h5.xml -$SRC_H5DUMP_TESTFILES/tarray2.h5.xml -$SRC_H5DUMP_TESTFILES/tarray3.h5.xml -$SRC_H5DUMP_TESTFILES/tarray6.h5.xml -$SRC_H5DUMP_TESTFILES/tarray7.h5.xml -$SRC_H5DUMP_TESTFILES/tattr.h5.xml -$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml -$SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml -$SRC_H5DUMP_TESTFILES/tcompound.h5.xml -$SRC_H5DUMP_TESTFILES/tcompound2.h5.xml -$SRC_H5DUMP_TESTFILES/tdatareg.h5.xml -$SRC_H5DUMP_TESTFILES/tdset.h5.xml -$SRC_H5DUMP_TESTFILES/tdset2.h5.xml -$SRC_H5DUMP_TESTFILES/tempty.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-dtd.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-dtd-2.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-dtd-uri.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-nons.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-nons-2.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml -$SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml -$SRC_H5DUMP_TESTFILES/tenum.h5.xml -$SRC_H5DUMP_TESTFILES/textlink.h5.xml -$SRC_H5DUMP_TESTFILES/tfpformat.h5.xml -$SRC_H5DUMP_TESTFILES/tgroup.h5.xml -$SRC_H5DUMP_TESTFILES/thlink.h5.xml -$SRC_H5DUMP_TESTFILES/tloop.h5.xml -$SRC_H5DUMP_TESTFILES/tloop2.h5.xml -$SRC_H5DUMP_TESTFILES/tmany.h5.xml -$SRC_H5DUMP_TESTFILES/tname-amp.h5.xml -$SRC_H5DUMP_TESTFILES/tname-apos.h5.xml -$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5.xml -$SRC_H5DUMP_TESTFILES/tname-gt.h5.xml -$SRC_H5DUMP_TESTFILES/tname-lt.h5.xml -$SRC_H5DUMP_TESTFILES/tname-quot.h5.xml -$SRC_H5DUMP_TESTFILES/tname-sp.h5.xml -$SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml -$SRC_H5DUMP_TESTFILES/tnodata.h5.xml -$SRC_H5DUMP_TESTFILES/tobjref.h5.xml -$SRC_H5DUMP_TESTFILES/topaque.h5.xml -$SRC_H5DUMP_TESTFILES/torderattr1.h5.xml -$SRC_H5DUMP_TESTFILES/torderattr2.h5.xml -$SRC_H5DUMP_TESTFILES/torderattr3.h5.xml -$SRC_H5DUMP_TESTFILES/torderattr4.h5.xml -$SRC_H5DUMP_TESTFILES/tref.h5.xml -$SRC_H5DUMP_TESTFILES/tref-escapes.h5.xml -$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5.xml -$SRC_H5DUMP_TESTFILES/tsaf.h5.xml -$SRC_H5DUMP_TESTFILES/tslink.h5.xml -$SRC_H5DUMP_TESTFILES/tstr.h5.xml -$SRC_H5DUMP_TESTFILES/tstr2.h5.xml -$SRC_H5DUMP_TESTFILES/tstring.h5.xml -$SRC_H5DUMP_TESTFILES/tstring-at.h5.xml -$SRC_H5DUMP_TESTFILES/tudlink.h5.xml -$SRC_H5DUMP_TESTFILES/tvldtypes1.h5.xml -$SRC_H5DUMP_TESTFILES/tvldtypes2.h5.xml -$SRC_H5DUMP_TESTFILES/tvldtypes3.h5.xml -$SRC_H5DUMP_TESTFILES/tvldtypes4.h5.xml -$SRC_H5DUMP_TESTFILES/tvldtypes5.h5.xml -$SRC_H5DUMP_TESTFILES/tvlstr.h5.xml -" - # # copy test files and expected output files from source dirs to test dir # @@ -1042,87 +899,6 @@ TOOLTEST3 filter_fail.ddl --enable-error-stack filter_fail.h5 # test for -o -y for dataset with attributes TOOLTEST tall-6.ddl --enable-error-stack -y -o data -d /g1/g1.1/dset1.1.1 tall.h5 -####### test for dataset packed bits ###### - -# test failure handling -# Missing file name -TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack -# Limits: -# Maximum number of packed bits is 8 (for now). -# Maximum integer size is 64 (for now). -# Maximun Offset is 63 (Maximum size - 1). -# Maximum Offset+Length is 64 (Maximum size). -# Tests: -# Normal operation on both signed and unsigned int datasets. -# Sanity check -# Their rawdata output should be the same. -TOOLTEST tpbitsSignedWhole.ddl --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5 -TOOLTEST tpbitsUnsignedWhole.ddl --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5 -TOOLTEST tpbitsSignedIntWhole.ddl --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5 -TOOLTEST tpbitsUnsignedIntWhole.ddl --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5 -TOOLTEST tpbitsSignedLongWhole.ddl --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5 -TOOLTEST tpbitsUnsignedLongWhole.ddl --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5 -TOOLTEST tpbitsSignedLongLongWhole.ddl --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLongWhole.ddl --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5 -TOOLTEST tpbitsSignedLongLongWhole63.ddl --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLongWhole63.ddl --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5 -TOOLTEST tpbitsSignedLongLongWhole1.ddl --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLongWhole1.ddl --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5 -# Half sections -TOOLTEST tpbitsSigned4.ddl --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5 -TOOLTEST tpbitsUnsigned4.ddl --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5 -TOOLTEST tpbitsSignedInt8.ddl --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5 -TOOLTEST tpbitsUnsignedInt8.ddl --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5 -TOOLTEST tpbitsSignedLong16.ddl --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5 -TOOLTEST tpbitsUnsignedLong16.ddl --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5 -TOOLTEST tpbitsSignedLongLong32.ddl --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLong32.ddl --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5 -# Quarter sections -TOOLTEST tpbitsSigned2.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 -TOOLTEST tpbitsUnsigned2.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 -TOOLTEST tpbitsSignedInt4.ddl --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 -TOOLTEST tpbitsUnsignedInt4.ddl --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 -TOOLTEST tpbitsSignedLong8.ddl --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 -TOOLTEST tpbitsUnsignedLong8.ddl --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 -TOOLTEST tpbitsSignedLongLong16.ddl --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLong16.ddl --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 -# Begin and End -TOOLTEST tpbitsSigned.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5 -TOOLTEST tpbitsUnsigned.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5 -TOOLTEST tpbitsSignedInt.ddl --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5 -TOOLTEST tpbitsUnsignedInt.ddl --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5 -TOOLTEST tpbitsSignedLong.ddl --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5 -TOOLTEST tpbitsUnsignedLong.ddl --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5 -TOOLTEST tpbitsSignedLongLong.ddl --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5 -TOOLTEST tpbitsUnsignedLongLong.ddl --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5 -# Overlapped packed bits. -TOOLTEST tpbitsOverlapped.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5 -# Maximum number of packed bits. -TOOLTEST tpbitsMax.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 -# Compound type. -TOOLTEST tpbitsCompound.ddl --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5 -# Array type. -TOOLTEST tpbitsArray.ddl --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5 -# Test Error handling. -# Too many packed bits requested. Max is 8 for now. -TOOLTEST tpbitsMaxExceeded.ddl --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 -# Offset too large. Max is 7 (8-1) for now. -TOOLTEST tpbitsOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5 -TOOLTEST tpbitsCharOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5 -TOOLTEST tpbitsIntOffsetExceeded.ddl --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5 -TOOLTEST tpbitsLongOffsetExceeded.ddl --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5 -# Bad offset, must not be negative. -TOOLTEST tpbitsOffsetNegative.ddl --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5 -# Bad length, must not be positive. -TOOLTEST tpbitsLengthPositive.ddl --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5 -# Offset+Length is too large. Max is 8 for now. -TOOLTEST tpbitsLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5 -TOOLTEST tpbitsCharLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5 -TOOLTEST tpbitsIntLengthExceeded.ddl --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5 -TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5 -# Incomplete pair of packed bits request. -TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 - # Report test results and exit if test $nerrors -eq 0 ; then diff --git a/tools/h5dump/testh5dumppbits.sh.in b/tools/h5dump/testh5dumppbits.sh.in new file mode 100644 index 0000000..393fcc1 --- /dev/null +++ b/tools/h5dump/testh5dumppbits.sh.in @@ -0,0 +1,495 @@ +#! /bin/sh +# +# Copyright by The HDF Group. +# 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://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have +# access to either file, you may request a copy from help@hdfgroup.org. +# +# Tests for the h5dump tool with packed bits type files + +# Determine which filters are available +USE_FILTER_SZIP="@USE_FILTER_SZIP@" +USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@" +USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@" +USE_FILTER_FLETCHER32="@USE_FILTER_FLETCHER32@" +USE_FILTER_NBIT="@USE_FILTER_NBIT@" +USE_FILTER_SCALEOFFSET="@USE_FILTER_SCALEOFFSET@" + +TESTNAME=h5dump +EXIT_SUCCESS=0 +EXIT_FAILURE=1 + +DUMPER=h5dump # The tool name +DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary + +H5DIFF=../h5diff/h5diff # The h5diff tool name +H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary + +H5IMPORT=../h5import/h5import # The h5import tool name +H5IMPORT_BIN=`pwd`/$H5IMPORT # The path of the h5import tool binary + + +CMP='cmp -s' +DIFF='diff -c' +CP='cp' + +nerrors=0 +verbose=yes + +# The build (current) directory might be different than the source directory. +if test -z "$srcdir"; then + srcdir=. +fi +# source dirs +SRC_TOOLS="$srcdir/../" + +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/packedbits.h5 +" + +LIST_OTHER_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/tnofilename-with-packed-bits.ddl +$SRC_H5DUMP_TESTFILES/tpbitsArray.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCompound.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIncomplete.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCharLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIntLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLongLengthExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLengthPositive.ddl +$SRC_H5DUMP_TESTFILES/tpbitsMax.ddl +$SRC_H5DUMP_TESTFILES/tpbitsMaxExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsCharOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsIntOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsLongOffsetExceeded.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOffsetNegative.ddl +$SRC_H5DUMP_TESTFILES/tpbitsOverlapped.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedIntWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole1.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLongWhole63.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong32.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSigned2.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsigned2.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedInt4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedInt4.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLong8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLong8.ddl +$SRC_H5DUMP_TESTFILES/tpbitsSignedLongLong16.ddl +$SRC_H5DUMP_TESTFILES/tpbitsUnsignedLongLong16.ddl +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES $LIST_OTHER_TEST_FILES $LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} + + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Testing". +# +TESTING() { + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Source in the output filter function definitions. +. $srcdir/../../bin/output_filter.sh + +# Run a test and print PASS or *FAIL*. If a test fails then increment +# the `nerrors' global variable and (if $verbose is set) display the +# difference between the actual output and the expected output. The +# expected output is given as the first argument to this function and +# the actual output file is calculated by replacing the `.ddl' with +# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a +# non-zero value. +# +TOOLTEST() { + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + cat $actual_err >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav $actual_ext + fi + +} + + +# same as TOOLTEST1 but compares generated file to expected output +# and compares the generated data file to the expected data file +# used for the binary tests that expect a full path in -o without -b +TOOLTEST2() { + + expectdata="$TESTDIR/$1" + expect="$TESTDIR/`basename $1 .exp`.ddl" + actualdata="$TESTDIR/`basename $1 .exp`.txt" + actual="$TESTDIR/`basename $1 .exp`.out" + actual_err="$TESTDIR/`basename $1 .exp`.err" + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + cat $actual_err >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + if [ ! -f $expectdata ]; then + # Create the expect data file if it doesn't yet exist. + echo " CREATED" + cp $actualdata $expectdata + elif $CMP $expectdata $actualdata; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected datafile (*.exp) differs from actual datafile (*.txt)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expectdata $actualdata |sed 's/^/ /' + fi + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actualdata $actual_err + fi + +} + +# same as TOOLTEST but filters error stack outp +# Extract file name, line number, version and thread IDs because they may be different +TOOLTEST3() { + + expect="$TESTDIR/$1" + actual="$TESTDIR/`basename $1 .ddl`.out" + actual_err="$TESTDIR/`basename $1 .ddl`.err" + actual_ext="$TESTDIR/`basename $1 .ddl`.ext" + actual_sav=${actual}-sav + actual_err_sav=${actual_err}-sav + shift + + # Run test. + TESTING $DUMPER $@ + ( + cd $TESTDIR + $RUNSERIAL $DUMPER_BIN "$@" + ) >$actual 2>$actual_err + + # save actual and actual_err in case they are needed later. + cp $actual $actual_sav + STDOUT_FILTER $actual + cp $actual_err $actual_err_sav + STDERR_FILTER $actual_err + + # Extract file name, line number, version and thread IDs because they may be different + sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + -e 's/H5Eget_auto[1-2]*/H5Eget_auto(1 or 2)/' \ + -e 's/H5Eset_auto[1-2]*/H5Eset_auto(1 or 2)/' \ + $actual_err > $actual_ext + cat $actual_ext >> $actual + + if [ ! -f $expect ]; then + # Create the expect file if it doesn't yet exist. + echo " CREATED" + cp $actual $expect + elif $CMP $expect $actual; then + echo " PASSED" + else + echo "*FAILED*" + echo " Expected result (*.ddl) differs from actual result (*.out)" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect $actual |sed 's/^/ /' + fi + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f $actual $actual_err $actual_sav $actual_err_sav + fi + +} + +# Print a "SKIP" message +SKIP() { + TESTING $DUMPER $@ + echo " -SKIP-" +} + +# Print a line-line message left justified in a field of 70 characters +# +PRINT_H5DIFF() { + SPACES=" " + echo " Running h5diff $* $SPACES" | cut -c1-70 | tr -d '\012' +} + + +# Call the h5diff tool +# +DIFFTEST() +{ + PRINT_H5DIFF $@ + ( + cd $TESTDIR + $RUNSERIAL $H5DIFF_BIN "$@" -q + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + +} + +# Print a line-line message left justified in a field of 70 characters +# beginning with the word "Verifying". +# +PRINT_H5IMPORT() { + SPACES=" " + echo " Running h5import $* $SPACES" | cut -c1-70 | tr -d '\012' +} + +# Call the h5import tool +# +IMPORTTEST() +{ + # remove the output hdf5 file if it exists + hdf5_file="$TESTDIR/$5" + if [ -f $hdf5_file ]; then + rm -f $hdf5_file + fi + + PRINT_H5IMPORT $@ + ( + cd $TESTDIR + $RUNSERIAL $H5IMPORT_BIN "$@" + ) + RET=$? + if [ $RET != 0 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi + +} + + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## +# prepare for test +COPY_TESTFILES_TO_TESTDIR + +####### test for dataset packed bits ###### + +# test failure handling +# Missing file name +TOOLTEST tnofilename-with-packed-bits.ddl --enable-error-stack +# Limits: +# Maximum number of packed bits is 8 (for now). +# Maximum integer size is 64 (for now). +# Maximun Offset is 63 (Maximum size - 1). +# Maximum Offset+Length is 64 (Maximum size). +# Tests: +# Normal operation on both signed and unsigned int datasets. +# Sanity check +# Their rawdata output should be the same. +TOOLTEST tpbitsSignedWhole.ddl --enable-error-stack -d /DS08BITS -M 0,8 packedbits.h5 +TOOLTEST tpbitsUnsignedWhole.ddl --enable-error-stack -d /DU08BITS -M 0,8 packedbits.h5 +TOOLTEST tpbitsSignedIntWhole.ddl --enable-error-stack -d /DS16BITS -M 0,16 packedbits.h5 +TOOLTEST tpbitsUnsignedIntWhole.ddl --enable-error-stack -d /DU16BITS -M 0,16 packedbits.h5 +TOOLTEST tpbitsSignedLongWhole.ddl --enable-error-stack -d /DS32BITS -M 0,32 packedbits.h5 +TOOLTEST tpbitsUnsignedLongWhole.ddl --enable-error-stack -d /DU32BITS -M 0,32 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole.ddl --enable-error-stack -d /DS64BITS -M 0,64 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole.ddl --enable-error-stack -d /DU64BITS -M 0,64 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole63.ddl --enable-error-stack -d /DS64BITS -M 0,63 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole63.ddl --enable-error-stack -d /DU64BITS -M 0,63 packedbits.h5 +TOOLTEST tpbitsSignedLongLongWhole1.ddl --enable-error-stack -d /DS64BITS -M 1,63 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLongWhole1.ddl --enable-error-stack -d /DU64BITS -M 1,63 packedbits.h5 +# Half sections +TOOLTEST tpbitsSigned4.ddl --enable-error-stack -d /DS08BITS -M 0,4,4,4 packedbits.h5 +TOOLTEST tpbitsUnsigned4.ddl --enable-error-stack -d /DU08BITS -M 0,4,4,4 packedbits.h5 +TOOLTEST tpbitsSignedInt8.ddl --enable-error-stack -d /DS16BITS -M 0,8,8,8 packedbits.h5 +TOOLTEST tpbitsUnsignedInt8.ddl --enable-error-stack -d /DU16BITS -M 0,8,8,8 packedbits.h5 +TOOLTEST tpbitsSignedLong16.ddl --enable-error-stack -d /DS32BITS -M 0,16,16,16 packedbits.h5 +TOOLTEST tpbitsUnsignedLong16.ddl --enable-error-stack -d /DU32BITS -M 0,16,16,16 packedbits.h5 +TOOLTEST tpbitsSignedLongLong32.ddl --enable-error-stack -d /DS64BITS -M 0,32,32,32 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong32.ddl --enable-error-stack -d /DU64BITS -M 0,32,32,32 packedbits.h5 +# Quarter sections +TOOLTEST tpbitsSigned2.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 +TOOLTEST tpbitsUnsigned2.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,2,4,2,6,2 packedbits.h5 +TOOLTEST tpbitsSignedInt4.ddl --enable-error-stack -d /DS16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 +TOOLTEST tpbitsUnsignedInt4.ddl --enable-error-stack -d /DU16BITS -M 0,4,4,4,8,4,12,4 packedbits.h5 +TOOLTEST tpbitsSignedLong8.ddl --enable-error-stack -d /DS32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 +TOOLTEST tpbitsUnsignedLong8.ddl --enable-error-stack -d /DU32BITS -M 0,8,8,8,16,8,24,8 packedbits.h5 +TOOLTEST tpbitsSignedLongLong16.ddl --enable-error-stack -d /DS64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong16.ddl --enable-error-stack -d /DU64BITS -M 0,16,16,16,32,16,48,16 packedbits.h5 +# Begin and End +TOOLTEST tpbitsSigned.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,6 packedbits.h5 +TOOLTEST tpbitsUnsigned.ddl --enable-error-stack -d /DU08BITS -M 0,2,2,6 packedbits.h5 +TOOLTEST tpbitsSignedInt.ddl --enable-error-stack -d /DS16BITS -M 0,2,10,6 packedbits.h5 +TOOLTEST tpbitsUnsignedInt.ddl --enable-error-stack -d /DU16BITS -M 0,2,10,6 packedbits.h5 +TOOLTEST tpbitsSignedLong.ddl --enable-error-stack -d /DS32BITS -M 0,2,26,6 packedbits.h5 +TOOLTEST tpbitsUnsignedLong.ddl --enable-error-stack -d /DU32BITS -M 0,2,26,6 packedbits.h5 +TOOLTEST tpbitsSignedLongLong.ddl --enable-error-stack -d /DS64BITS -M 0,2,58,6 packedbits.h5 +TOOLTEST tpbitsUnsignedLongLong.ddl --enable-error-stack -d /DU64BITS -M 0,2,58,6 packedbits.h5 +# Overlapped packed bits. +TOOLTEST tpbitsOverlapped.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,0,3 packedbits.h5 +# Maximum number of packed bits. +TOOLTEST tpbitsMax.ddl --enable-error-stack -d /DS08BITS -M 0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 +# Compound type. +TOOLTEST tpbitsCompound.ddl --enable-error-stack -d /dset1 -M 0,1,1,1 tcompound.h5 +# Array type. +TOOLTEST tpbitsArray.ddl --enable-error-stack -d /Dataset1 -M 0,1,1,1 tarray1.h5 +# Test Error handling. +# Too many packed bits requested. Max is 8 for now. +TOOLTEST tpbitsMaxExceeded.ddl --enable-error-stack -d /DS08BITS -M 0,1,0,1,1,1,2,1,3,1,4,1,5,1,6,1,7,1 packedbits.h5 +# Offset too large. Max is 7 (8-1) for now. +TOOLTEST tpbitsOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 64,1 packedbits.h5 +TOOLTEST tpbitsCharOffsetExceeded.ddl --enable-error-stack -d /DS08BITS -M 8,1 packedbits.h5 +TOOLTEST tpbitsIntOffsetExceeded.ddl --enable-error-stack -d /DS16BITS -M 16,1 packedbits.h5 +TOOLTEST tpbitsLongOffsetExceeded.ddl --enable-error-stack -d /DS32BITS -M 32,1 packedbits.h5 +# Bad offset, must not be negative. +TOOLTEST tpbitsOffsetNegative.ddl --enable-error-stack -d /DS08BITS -M -1,1 packedbits.h5 +# Bad length, must not be positive. +TOOLTEST tpbitsLengthPositive.ddl --enable-error-stack -d /DS08BITS -M 4,0 packedbits.h5 +# Offset+Length is too large. Max is 8 for now. +TOOLTEST tpbitsLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 37,28 packedbits.h5 +TOOLTEST tpbitsCharLengthExceeded.ddl --enable-error-stack -d /DS08BITS -M 2,7 packedbits.h5 +TOOLTEST tpbitsIntLengthExceeded.ddl --enable-error-stack -d /DS16BITS -M 10,7 packedbits.h5 +TOOLTEST tpbitsLongLengthExceeded.ddl --enable-error-stack -d /DS32BITS -M 26,7 packedbits.h5 +# Incomplete pair of packed bits request. +TOOLTEST tpbitsIncomplete.ddl --enable-error-stack -d /DS08BITS -M 0,2,2,1,0,2,2, packedbits.h5 + + +# Report test results and exit +if test $nerrors -eq 0 ; then + echo "All $TESTNAME tests passed." + exit $EXIT_SUCCESS +else + echo "$TESTNAME tests failed with $nerrors errors." + exit $EXIT_FAILURE +fi diff --git a/tools/h5dump/testh5dumpxml.sh.in b/tools/h5dump/testh5dumpxml.sh.in index 1bbf232..4e6081b 100644 --- a/tools/h5dump/testh5dumpxml.sh.in +++ b/tools/h5dump/testh5dumpxml.sh.in @@ -26,6 +26,7 @@ DUMPER_BIN=`pwd`/$DUMPER # The path of the tool binary CMP='cmp -s' DIFF='diff -c' +CP='cp' nerrors=0 verbose=yes @@ -34,8 +35,176 @@ verbose=yes if test -z "$srcdir"; then srcdir=. fi +# source dirs +SRC_TOOLS="$srcdir/../" -test -d ../testfiles || mkdir ../testfiles +SRC_TOOLS_TESTFILES="$SRC_TOOLS/testfiles" +# testfiles source dirs for tools +SRC_H5LS_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DUMP_TESTFILES="$SRC_TOOLS_TESTFILES" +SRC_H5DIFF_TESTFILES="$SRC_TOOLS/h5diff/testfiles" +SRC_H5COPY_TESTFILES="$SRC_TOOLS/h5copy/testfiles" +SRC_H5REPACK_TESTFILES="$SRC_TOOLS/h5repack/testfiles" +SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles" +SRC_H5STAT_TESTFILES="$SRC_TOOLS/h5stat/testfiles" +SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles" + +TESTDIR=./testfiles +test -d $TESTDIR || mkdir $TESTDIR + +###################################################################### +# test files +# -------------------------------------------------------------------- +# All the test files copy from source directory to test directory +# NOTE: Keep this framework to add/remove test files. +# Any test files from other tools can be used in this framework. +# This list are also used for checking exist. +# Comment '#' without space can be used. +# -------------------------------------------------------------------- +LIST_HDF5_TEST_FILES_XML=" +$SRC_H5DUMP_TESTFILES/tall.h5 +$SRC_H5DUMP_TESTFILES/tarray1.h5 +$SRC_H5DUMP_TESTFILES/tarray2.h5 +$SRC_H5DUMP_TESTFILES/tarray3.h5 +$SRC_H5DUMP_TESTFILES/tarray6.h5 +$SRC_H5DUMP_TESTFILES/tarray7.h5 +$SRC_H5DUMP_TESTFILES/tattr.h5 +$SRC_H5DUMP_TESTFILES/tbitfields.h5 +$SRC_H5DUMP_TESTFILES/tcompound.h5 +$SRC_H5DUMP_TESTFILES/tcompound2.h5 +$SRC_H5DUMP_TESTFILES/tcompound_complex.h5 +$SRC_H5DUMP_TESTFILES/tdatareg.h5 +$SRC_H5DUMP_TESTFILES/tdset.h5 +$SRC_H5DUMP_TESTFILES/tdset2.h5 +$SRC_H5DUMP_TESTFILES/tempty.h5 +$SRC_H5DUMP_TESTFILES/tenum.h5 +$SRC_H5DUMP_TESTFILES/textlink.h5 +$SRC_H5DUMP_TESTFILES/tfpformat.h5 +$SRC_H5DUMP_TESTFILES/tgroup.h5 +$SRC_H5DUMP_TESTFILES/thlink.h5 +$SRC_H5DUMP_TESTFILES/tloop.h5 +$SRC_H5DUMP_TESTFILES/tloop2.h5 +$SRC_H5DUMP_TESTFILES/tmany.h5 +$SRC_H5DUMP_TESTFILES/tname-amp.h5 +$SRC_H5DUMP_TESTFILES/tname-apos.h5 +$SRC_H5DUMP_TESTFILES/tname-gt.h5 +$SRC_H5DUMP_TESTFILES/tname-lt.h5 +$SRC_H5DUMP_TESTFILES/tname-quot.h5 +$SRC_H5DUMP_TESTFILES/tname-sp.h5 +$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5 +$SRC_H5DUMP_TESTFILES/tnestedcomp.h5 +$SRC_H5DUMP_TESTFILES/tnodata.h5 +$SRC_H5DUMP_TESTFILES/tobjref.h5 +$SRC_H5DUMP_TESTFILES/topaque.h5 +$SRC_H5DUMP_TESTFILES/torderattr.h5 +$SRC_H5DUMP_TESTFILES/tref.h5 +$SRC_H5DUMP_TESTFILES/tref-escapes.h5 +$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5 +$SRC_H5DUMP_TESTFILES/tsaf.h5 +$SRC_H5DUMP_TESTFILES/tslink.h5 +$SRC_H5DUMP_TESTFILES/tstring.h5 +$SRC_H5DUMP_TESTFILES/tstring-at.h5 +$SRC_H5DUMP_TESTFILES/tstr.h5 +$SRC_H5DUMP_TESTFILES/tstr2.h5 +$SRC_H5DUMP_TESTFILES/tudlink.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes1.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes2.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes3.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes4.h5 +$SRC_H5DUMP_TESTFILES/tvldtypes5.h5 +$SRC_H5DUMP_TESTFILES/tvlstr.h5 +" + +LIST_OTHER_TEST_FILES_XML=" +$SRC_H5DUMP_TESTFILES/tall.h5.xml +$SRC_H5DUMP_TESTFILES/tall-2A.h5.xml +$SRC_H5DUMP_TESTFILES/tarray1.h5.xml +$SRC_H5DUMP_TESTFILES/tarray2.h5.xml +$SRC_H5DUMP_TESTFILES/tarray3.h5.xml +$SRC_H5DUMP_TESTFILES/tarray6.h5.xml +$SRC_H5DUMP_TESTFILES/tarray7.h5.xml +$SRC_H5DUMP_TESTFILES/tattr.h5.xml +$SRC_H5DUMP_TESTFILES/tbitfields.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound_complex.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound.h5.xml +$SRC_H5DUMP_TESTFILES/tcompound2.h5.xml +$SRC_H5DUMP_TESTFILES/tdatareg.h5.xml +$SRC_H5DUMP_TESTFILES/tdset.h5.xml +$SRC_H5DUMP_TESTFILES/tdset2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd-2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-dtd-uri.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons-2.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-nons-uri.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-ns.h5.xml +$SRC_H5DUMP_TESTFILES/tempty-ns-2.h5.xml +$SRC_H5DUMP_TESTFILES/tenum.h5.xml +$SRC_H5DUMP_TESTFILES/textlink.h5.xml +$SRC_H5DUMP_TESTFILES/tfpformat.h5.xml +$SRC_H5DUMP_TESTFILES/tgroup.h5.xml +$SRC_H5DUMP_TESTFILES/thlink.h5.xml +$SRC_H5DUMP_TESTFILES/tloop.h5.xml +$SRC_H5DUMP_TESTFILES/tloop2.h5.xml +$SRC_H5DUMP_TESTFILES/tmany.h5.xml +$SRC_H5DUMP_TESTFILES/tname-amp.h5.xml +$SRC_H5DUMP_TESTFILES/tname-apos.h5.xml +$SRC_H5DUMP_TESTFILES/tnamed_dtype_attr.h5.xml +$SRC_H5DUMP_TESTFILES/tname-gt.h5.xml +$SRC_H5DUMP_TESTFILES/tname-lt.h5.xml +$SRC_H5DUMP_TESTFILES/tname-quot.h5.xml +$SRC_H5DUMP_TESTFILES/tname-sp.h5.xml +$SRC_H5DUMP_TESTFILES/tnestedcomp.h5.xml +$SRC_H5DUMP_TESTFILES/tnodata.h5.xml +$SRC_H5DUMP_TESTFILES/tobjref.h5.xml +$SRC_H5DUMP_TESTFILES/topaque.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr1.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr2.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr3.h5.xml +$SRC_H5DUMP_TESTFILES/torderattr4.h5.xml +$SRC_H5DUMP_TESTFILES/tref.h5.xml +$SRC_H5DUMP_TESTFILES/tref-escapes.h5.xml +$SRC_H5DUMP_TESTFILES/tref-escapes-at.h5.xml +$SRC_H5DUMP_TESTFILES/tsaf.h5.xml +$SRC_H5DUMP_TESTFILES/tslink.h5.xml +$SRC_H5DUMP_TESTFILES/tstr.h5.xml +$SRC_H5DUMP_TESTFILES/tstr2.h5.xml +$SRC_H5DUMP_TESTFILES/tstring.h5.xml +$SRC_H5DUMP_TESTFILES/tstring-at.h5.xml +$SRC_H5DUMP_TESTFILES/tudlink.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes1.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes2.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes3.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes4.h5.xml +$SRC_H5DUMP_TESTFILES/tvldtypes5.h5.xml +$SRC_H5DUMP_TESTFILES/tvlstr.h5.xml +" + +# +# copy test files and expected output files from source dirs to test dir +# +COPY_TESTFILES="$LIST_HDF5_TEST_FILES_XML $LIST_OTHER_TEST_FILES_XML" + +COPY_TESTFILES_TO_TESTDIR() +{ + # copy test files. Used -f to make sure get a new copy + for tstfile in $COPY_TESTFILES + do + # ignore '#' comment + echo $tstfile | tr -d ' ' | grep '^#' > /dev/null + RET=$? + if [ $RET -eq 1 ]; then + if [ -a $tstfile ]; then + $CP -f $tstfile $TESTDIR + else + echo "Error: FAILED to copy $tstfile" + echo " $tstfile doesn't exist!" + exit $EXIT_FAILURE + fi + fi + done +} # Print a line-line message left justified in a field of 70 characters # beginning with the word "Testing". -- cgit v0.12 From b904ca7ec369149f858495860795fd7afcba8670 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 22 May 2012 16:36:45 -0500 Subject: [svn-r22391] HDFFV-7999: h5dump did not display H5T_DSET_UTF8. Changed if/else block to switch like in h5ls, and distinguished between ERROR and UNKNOWN. Reviewed by JKM Tested: local linux --- MANIFEST | 2 ++ tools/h5dump/CMakeLists.txt | 7 ++++ tools/h5dump/h5dumpgentest.c | 50 +++++++++++++++++++++++++++++ tools/h5dump/testh5dump.sh.in | 5 +++ tools/lib/h5tools_dump.c | 73 +++++++++++++++++++++++++++++++++++------- tools/testfiles/charsets.ddl | 27 ++++++++++++++++ tools/testfiles/charsets.h5 | Bin 0 -> 8288 bytes 7 files changed, 152 insertions(+), 12 deletions(-) create mode 100644 tools/testfiles/charsets.ddl create mode 100644 tools/testfiles/charsets.h5 diff --git a/MANIFEST b/MANIFEST index ea78fc3..2fc3949 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1280,6 +1280,8 @@ ./tools/h5stat/testfiles/h5stat_tsohm.h5 # h5dump test files +./tools/testfiles/charsets.h5 +./tools/testfiles/charsets.ddl ./tools/testfiles/family_file00000.h5 ./tools/testfiles/family_file00001.h5 ./tools/testfiles/family_file00002.h5 diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index a6e452d..ad19ba4 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -43,6 +43,7 @@ IF (BUILD_TESTING) # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- SET (HDF5_REFERENCE_FILES + charsets.ddl file_space.ddl filter_fail.ddl packedbits.ddl @@ -239,6 +240,7 @@ IF (BUILD_TESTING) tvlstr.h5.xml ) SET (HDF5_REFERENCE_TEST_FILES + charsets.h5 file_space.h5 filter_fail.h5 packedbits.h5 @@ -676,6 +678,8 @@ IF (BUILD_TESTING) COMMAND ${CMAKE_COMMAND} -E remove h5dump-help.out + charsets.out + charsets.out.err file_space.out file_space.out.err filter_fail.out @@ -1060,6 +1064,9 @@ IF (BUILD_TESTING) # test printing characters in ASCII instead of decimal ADD_H5_TEST (tchar1 0 --enable-error-stack -r tchar.h5) + # test datatypes in ASCII and UTF8 + ADD_H5_TEST (charsets 0 --enable-error-stack charsets.h5) + # rev. 2004 # tests for super block ADD_H5_TEST (tboot1 0 --enable-error-stack -H -B -d dset tfcontents1.h5) diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index b28f3de..4fab379 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -97,6 +97,7 @@ #define FILE65 "file_space.h5" #define FILE66 "packedbits.h5" #define FILE67 "zerodim.h5" +#define FILE68 "charsets.h5" @@ -7132,6 +7133,54 @@ gent_packedbits(void) } /*------------------------------------------------------------------------- + * Function: gent_charsets + * + * Purpose: Generate a file to be used in the character set test + * Contains: + * 1) a ascii datatype + * 2) a utf8 datatype + * + *------------------------------------------------------------------------- + */ +static void +gent_charsets(void) +{ + hid_t fid, did, sid; + herr_t status; + hsize_t dim[] = {1}; /* Dataspace dimensions */ + typedef struct CharSetInfo { + const char *ascii_p_; + const char *utf8_p_; + } CharSetInfo; + + sid = H5Screate_simple( 1, dim, NULL ); + fid = H5Fcreate( FILE68, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); + + hid_t charset_dtid = H5Tcreate( H5T_COMPOUND, sizeof( CharSetInfo ) ); + + hid_t ascii_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); + status = H5Tset_cset( ascii_dtid, H5T_CSET_ASCII ); + H5Tinsert( charset_dtid, "ascii", HOFFSET(CharSetInfo, ascii_p_ ), ascii_dtid ); + + hid_t utf8_dtid = H5Tcreate( H5T_STRING, H5T_VARIABLE ); + status = H5Tset_cset( utf8_dtid, H5T_CSET_UTF8 ); + H5Tinsert( charset_dtid, "utf8", HOFFSET( CharSetInfo, utf8_p_ ), utf8_dtid ); + + did = H5Dcreate2( fid, "CharSets", charset_dtid, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT ); + + const char * writeData[] = { "ascii", "utf8", }; + status = H5Dwrite( did, charset_dtid, H5S_ALL, H5S_ALL, H5P_DEFAULT, writeData ); + + H5Tclose( charset_dtid ); + H5Tclose( ascii_dtid ); + H5Tclose( utf8_dtid ); + H5Sclose( sid ); + H5Dclose( did ); + H5Fclose( fid ); +} + + +/*------------------------------------------------------------------------- * Function: main * *------------------------------------------------------------------------- @@ -7207,6 +7256,7 @@ int main(void) gent_extlinks(); gent_fs_strategy_threshold(); gent_packedbits(); + gent_charsets(); return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 5441e25..016b4f1 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -75,6 +75,7 @@ test -d $TESTDIR || mkdir $TESTDIR # Comment '#' without space can be used. # -------------------------------------------------------------------- LIST_HDF5_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/charsets.h5 $SRC_H5DUMP_TESTFILES/file_space.h5 $SRC_H5DUMP_TESTFILES/filter_fail.h5 $SRC_H5DUMP_TESTFILES/packedbits.h5 @@ -161,6 +162,7 @@ $SRC_H5DUMP_TESTFILES/tvms.h5 " LIST_OTHER_TEST_FILES=" +$SRC_H5DUMP_TESTFILES/charsets.ddl $SRC_H5DUMP_TESTFILES/file_space.ddl $SRC_H5DUMP_TESTFILES/filter_fail.ddl $SRC_H5DUMP_TESTFILES/packedbits.ddl @@ -691,6 +693,9 @@ TOOLTEST tno-subset.ddl --no-compact-subset -d "AHFINDERDIRECT::ah_centroid_t[0] # test printing characters in ASCII instead of decimal TOOLTEST tchar1.ddl --enable-error-stack -r tchar.h5 +# test datatypes in ASCII and UTF8 +TOOLTEST charsets.ddl --enable-error-stack charsets.h5 + # rev. 2004 # tests for super block diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 194e85e..20c1c8f 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -2119,14 +2119,38 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_reset(buffer); h5tools_str_append(buffer, "%s ", STRPAD); - if (str_pad == H5T_STR_NULLTERM) - h5tools_str_append(buffer, "H5T_STR_NULLTERM;"); - else if (str_pad == H5T_STR_NULLPAD) - h5tools_str_append(buffer, "H5T_STR_NULLPAD;"); - else if (str_pad == H5T_STR_SPACEPAD) - h5tools_str_append(buffer, "H5T_STR_SPACEPAD;"); - else - h5tools_str_append(buffer, "H5T_STR_ERROR;"); + switch (str_pad) { + case H5T_STR_NULLTERM: + h5tools_str_append(buffer, "H5T_STR_NULLTERM;"); + break; + case H5T_STR_NULLPAD: + h5tools_str_append(buffer, "H5T_STR_NULLPAD;"); + break; + case H5T_STR_SPACEPAD: + h5tools_str_append(buffer, "H5T_STR_SPACEPAD;"); + break; + case H5T_STR_RESERVED_3: + case H5T_STR_RESERVED_4: + case H5T_STR_RESERVED_5: + case H5T_STR_RESERVED_6: + case H5T_STR_RESERVED_7: + case H5T_STR_RESERVED_8: + case H5T_STR_RESERVED_9: + case H5T_STR_RESERVED_10: + case H5T_STR_RESERVED_11: + case H5T_STR_RESERVED_12: + case H5T_STR_RESERVED_13: + case H5T_STR_RESERVED_14: + case H5T_STR_RESERVED_15: + h5tools_str_append(buffer, "H5T_STR_UNKNOWN;"); + break; + case H5T_STR_ERROR: + h5tools_str_append(buffer, "H5T_STR_ERROR;"); + break; + default: + h5tools_str_append(buffer, "ERROR;"); + break; + } h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); ctx->need_prefix = TRUE; @@ -2136,10 +2160,35 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ h5tools_str_append(buffer, "%s ", CSET); - if (cset == H5T_CSET_ASCII) - h5tools_str_append(buffer, "H5T_CSET_ASCII;"); - else - h5tools_str_append(buffer, "unknown_cset;"); + switch (cset) { + case H5T_CSET_ASCII: + h5tools_str_append(buffer, "H5T_CSET_ASCII;"); + break; + case H5T_CSET_UTF8: + h5tools_str_append(buffer, "H5T_CSET_UTF8;"); + break; + case H5T_CSET_RESERVED_2: + case H5T_CSET_RESERVED_3: + case H5T_CSET_RESERVED_4: + case H5T_CSET_RESERVED_5: + case H5T_CSET_RESERVED_6: + case H5T_CSET_RESERVED_7: + case H5T_CSET_RESERVED_8: + case H5T_CSET_RESERVED_9: + case H5T_CSET_RESERVED_10: + case H5T_CSET_RESERVED_11: + case H5T_CSET_RESERVED_12: + case H5T_CSET_RESERVED_13: + case H5T_CSET_RESERVED_14: + case H5T_CSET_RESERVED_15: + h5tools_str_append(buffer, "H5T_CSET_UNKNOWN;"); + case H5T_CSET_ERROR: + h5tools_str_append(buffer, "H5T_CSET_ERROR;"); + break; + default: + h5tools_str_append(buffer, "ERROR;"); + break; + } h5tools_render_element(stream, info, ctx, buffer, &curr_pos, ncols, 0, 0); ctx->need_prefix = TRUE; diff --git a/tools/testfiles/charsets.ddl b/tools/testfiles/charsets.ddl new file mode 100644 index 0000000..c2301fb --- /dev/null +++ b/tools/testfiles/charsets.ddl @@ -0,0 +1,27 @@ +HDF5 "charsets.h5" { +GROUP "/" { + DATASET "CharSets" { + DATATYPE H5T_COMPOUND { + H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_ASCII; + CTYPE H5T_C_S1; + } "ascii"; + H5T_STRING { + STRSIZE H5T_VARIABLE; + STRPAD H5T_STR_NULLTERM; + CSET H5T_CSET_UTF8; + CTYPE H5T_C_S1; + } "utf8"; + } + DATASPACE SIMPLE { ( 1 ) / ( 1 ) } + DATA { + (0): { + "ascii", + "utf8" + } + } + } +} +} diff --git a/tools/testfiles/charsets.h5 b/tools/testfiles/charsets.h5 new file mode 100644 index 0000000..2b9e735 Binary files /dev/null and b/tools/testfiles/charsets.h5 differ -- cgit v0.12 From 24810fd2165dba146c570d583b3c7c3939be0880 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Tue, 22 May 2012 23:47:31 -0500 Subject: [svn-r22392] Added test for h5tcreate_f with H5T_STRING_F option. Cleaned-up formating and comments for h5tcreate_f. Tested: jam (gnu compiler) --- fortran/src/H5Tff.f90 | 57 +++++++++++++++++++++++++-------------------------- fortran/test/tH5T.f90 | 45 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 29 deletions(-) diff --git a/fortran/src/H5Tff.f90 b/fortran/src/H5Tff.f90 index f5369d0..fd857a8 100644 --- a/fortran/src/H5Tff.f90 +++ b/fortran/src/H5Tff.f90 @@ -2050,17 +2050,19 @@ CONTAINS ! h5tcreate_f ! ! PURPOSE -! Creates a new dataype +! Creates a new datatype. ! ! INPUTS -! class - datatype class, possible values are: -! H5T_COMPOUND_F -! H5T_ENUM_F -! H5T_OPAQUE_F -! size - datattype size +! class - Datatype class can be one of: +! H5T_COMPOUND_F +! H5T_ENUM_F +! H5T_OPAQUE_F +! H5T_STRING_F +! +! size - Size of the datatype. ! OUTPUTS -! type_id - datatype identifier -! hdferr - Returns 0 if successful and -1 if fails +! type_id - Datatype identifier. +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -2072,29 +2074,26 @@ CONTAINS ! port). March 7, 2001 ! SOURCE SUBROUTINE h5tcreate_f(class, size, type_id, hdferr) - IMPLICIT NONE - INTEGER, INTENT(IN) :: class ! Datatype class can be one of - ! H5T_COMPOUND_F - ! H5T_ENUM_F - ! H5T_OPAQUE_F - INTEGER(SIZE_T), INTENT(IN) :: size ! Size of the datatype - INTEGER(HID_T), INTENT(OUT) :: type_id ! Datatype identifier - INTEGER, INTENT(OUT) :: hdferr ! Error code + IMPLICIT NONE + INTEGER , INTENT(IN) :: class + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER(HID_T) , INTENT(OUT) :: type_id + INTEGER , INTENT(OUT) :: hdferr !***** - INTERFACE - INTEGER FUNCTION h5tcreate_c(class, size, type_id) - USE H5GLOBAL - !DEC$IF DEFINED(HDF5F90_WINDOWS) - !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c - !DEC$ENDIF - INTEGER, INTENT(IN) :: class - INTEGER(SIZE_T), INTENT(IN) :: size - INTEGER(HID_T), INTENT(OUT) :: type_id - END FUNCTION h5tcreate_c - END INTERFACE + INTERFACE + INTEGER FUNCTION h5tcreate_c(class, size, type_id) + USE H5GLOBAL + !DEC$IF DEFINED(HDF5F90_WINDOWS) + !DEC$ATTRIBUTES C,reference,decorate,alias:'H5TCREATE_C'::h5tcreate_c + !DEC$ENDIF + INTEGER, INTENT(IN) :: class + INTEGER(SIZE_T), INTENT(IN) :: size + INTEGER(HID_T), INTENT(OUT) :: type_id + END FUNCTION h5tcreate_c + END INTERFACE - hdferr = h5tcreate_c(class, size, type_id) - END SUBROUTINE h5tcreate_f + hdferr = h5tcreate_c(class, size, type_id) + END SUBROUTINE h5tcreate_f ! !****s* H5T/h5tinsert_f diff --git a/fortran/test/tH5T.f90 b/fortran/test/tH5T.f90 index 6af1ba6..9605c45 100644 --- a/fortran/test/tH5T.f90 +++ b/fortran/test/tH5T.f90 @@ -108,6 +108,51 @@ INTEGER(HID_T) :: decoded_sid1 INTEGER(HID_T) :: decoded_tid1 + INTEGER(HID_T) :: fixed_str1, fixed_str2 + LOGICAL :: are_equal + INTEGER(SIZE_T), PARAMETER :: str_size = 10 + INTEGER(SIZE_T) :: query_size + + ! Test h5tcreate_f with H5T_STRING_F option: + ! Create fixed-length string in two ways and make sure they are the same + + CALL h5tcopy_f(H5T_FORTRAN_S1, fixed_str1, error) + CALL check("h5tcopy_f", error, total_error) + CALL h5tset_size_f(fixed_str1, str_size, error) + CALL check("h5tset_size_f", error, total_error) + CALL h5tset_strpad_f(fixed_str1, H5T_STR_NULLTERM_F, error) + CALL check("h5tset_strpad_f", error, total_error) + + CALL h5tcreate_f(H5T_STRING_F, str_size, fixed_str2, error) + CALL check("h5tcreate_f", error, total_error) + CALL h5tset_strpad_f(fixed_str2, H5T_STR_NULLTERM_F, error) + CALL check("h5tset_strpad_f", error, total_error) + + CALL h5tequal_f(fixed_str1, fixed_str2, are_equal, error) + IF(.NOT.are_equal)THEN + CALL check("h5tcreate_f", -1, total_error) + ENDIF + + CALL h5tget_size_f(fixed_str1, query_size, error) + CALL check("h5tget_size_f", error, total_error) + + IF(query_size.NE.str_size)THEN + CALL check("h5tget_size_f", -1, total_error) + ENDIF + + CALL h5tget_size_f(fixed_str2, query_size, error) + CALL check("h5tget_size_f", error, total_error) + + IF(query_size.NE.str_size)THEN + CALL check("h5tget_size_f", -1, total_error) + ENDIF + + CALL h5tclose_f(fixed_str1,error) + CALL check("h5tclose_f", error, total_error) + + CALL h5tclose_f(fixed_str2,error) + CALL check("h5tclose_f", error, total_error) + data_dims(1) = dimsize ! ! Initialize data buffer. -- cgit v0.12 From 955b84369e870d14b922d97d3725a8b11778152d Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Wed, 23 May 2012 09:42:43 -0500 Subject: [svn-r22393] I forgot to close a few datatypes in test_str_create. I fixed them in this commit. Tested on jam - very simple change. --- test/dtypes.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/dtypes.c b/test/dtypes.c index 23a7bac..3db9bf8 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -3964,6 +3964,9 @@ test_str_create(void) if((query_size = H5Tget_size(fixed_str2)) == 0) goto error; if(query_size != str_size) goto error; + if(H5Tclose(fixed_str1) < 0) goto error; + if(H5Tclose(fixed_str2) < 0) goto error; + /* Create variable-length string in two ways and make sure they are the same */ if((vlen_str1 = mkstr((size_t)H5T_VARIABLE, H5T_STR_NULLTERM)) < 0) goto error; @@ -3978,6 +3981,8 @@ test_str_create(void) if((is_vl_str = H5Tis_variable_str(vlen_str2)) < 0) goto error; if(!is_vl_str) goto error; + if(H5Tclose(vlen_str1) < 0) goto error; + if(H5Tclose(vlen_str2) < 0) goto error; PASSED(); return 0; -- cgit v0.12 From 01553cb8f7dca506522b4349043348cccecc318e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 23 May 2012 13:15:08 -0500 Subject: [svn-r22396] Correct missing clean filenames in h5dump make Sync 518/trunk version and cpack info --- CMakeLists.txt | 21 ++++++--------------- tools/h5dump/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b9c2a2..02da1a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -194,7 +194,11 @@ SET (HDF5_PACKAGE_NAME "HDF5") SET (HDF5_PACKAGE_VERSION "${H5_VERS_MAJOR}.${H5_VERS_MINOR}.${H5_VERS_RELEASE}") SET (HDF5_PACKAGE_VERSION_MAJOR "${H5_VERS_MAJOR}.${H5_VERS_MINOR}") SET (HDF5_PACKAGE_VERSION_MINOR "${H5_VERS_RELEASE}") -SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +IF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}-${H5_VERS_SUBRELEASE}") +ELSE (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") + SET (HDF5_PACKAGE_VERSION_STRING "${HDF5_PACKAGE_VERSION}") +ENDIF (NOT "${H5_VERS_SUBRELEASE}" STREQUAL "") SET (HDF5_PACKAGE_SOVERSION "${H5_SOVERS_MAJOR}.${H5_SOVERS_MINOR}.${H5_SOVERS_RELEASE}") SET (HDF5_PACKAGE_STRING "${HDF5_PACKAGE_NAME} ${HDF5_PACKAGE_VERSION_STRING}") SET (HDF5_PACKAGE_TARNAME "hdf5") @@ -439,19 +443,6 @@ IF (CMAKE_COMPILER_IS_GNUCXX) ENDIF (CMAKE_COMPILER_IS_GNUCXX) #----------------------------------------------------------------------------- -# Use gcc visibility flag. -#----------------------------------------------------------------------------- -OPTION (HDF5_ENABLE_VISIBILITY "Enable gcc4 visibility=hidden for Libraries and Programs" OFF) -IF (HDF5_ENABLE_VISIBILITY) - IF (CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") - ENDIF (CMAKE_COMPILER_IS_GNUCC) - IF (CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") - ENDIF (CMAKE_COMPILER_IS_GNUCXX) -ENDIF (HDF5_ENABLE_VISIBILITY) - -#----------------------------------------------------------------------------- # All libs/tests/examples need the main include directories #----------------------------------------------------------------------------- INCLUDE_DIRECTORIES (${HDF5_BINARY_DIR} ${HDF5_SRC_DIR}) @@ -561,7 +552,7 @@ IF (HDF5_ENABLE_Z_LIB_SUPPORT) SET (H5_HAVE_LIBZ 1) MESSAGE (STATUS "Filter ZLIB is built") ELSE (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - MESSAGE (FATAL " ZLib is Required for ZLib support in HDF5") + MESSAGE (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") ENDIF (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "SVN" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") ENDIF (ZLIB_FOUND) ELSE (NOT H5_ZLIB_HEADER) diff --git a/tools/h5dump/Makefile.am b/tools/h5dump/Makefile.am index 38864f5..f80d12e 100644 --- a/tools/h5dump/Makefile.am +++ b/tools/h5dump/Makefile.am @@ -46,6 +46,6 @@ h5dump_SOURCES=h5dump.c h5dump_ddl.c h5dump_xml.c # Temporary files. *.h5 are generated by h5dumpgentest. They should # copied to the testfiles/ directory if update is required. CHECK_CLEANFILES+=*.h5 *.bin -DISTCLEANFILES=testh5dump.sh +DISTCLEANFILES=testh5dump.sh testh5dumppbits.sh testh5dumpxml.sh include $(top_srcdir)/config/conclude.am -- cgit v0.12 From 336a7430689b067d2ad4632988d534812a08c8de Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 24 May 2012 16:50:06 -0500 Subject: [svn-r22405] HDFFV-8018: add INSTALL commands for packaging the pdb files for windows when configured with RelWithDebInfo Tested: local linux and Windows --- c++/src/CMakeLists.txt | 3 +++ config/cmake/HDFLibMacros.cmake | 18 +++++++++--------- config/cmake/HDFMacros.cmake | 31 +++++++++++++++++++++++++++++++ fortran/src/CMakeLists.txt | 4 ++++ hl/c++/src/CMakeLists.txt | 3 +++ hl/fortran/src/CMakeLists.txt | 4 ++++ hl/src/CMakeLists.txt | 3 +++ src/CMakeLists.txt | 3 +++ tools/h5copy/CMakeLists.txt | 3 +++ tools/h5diff/CMakeLists.txt | 6 ++++++ tools/h5dump/CMakeLists.txt | 3 +++ tools/h5import/CMakeLists.txt | 3 +++ tools/h5jam/CMakeLists.txt | 3 +++ tools/h5ls/CMakeLists.txt | 3 +++ tools/h5repack/CMakeLists.txt | 3 +++ tools/h5stat/CMakeLists.txt | 3 +++ tools/lib/CMakeLists.txt | 16 ++++++++++++++++ tools/misc/CMakeLists.txt | 5 +++++ 18 files changed, 108 insertions(+), 9 deletions(-) diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt index d2bc71a..375bd4a 100644 --- a/c++/src/CMakeLists.txt +++ b/c++/src/CMakeLists.txt @@ -103,6 +103,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} cpplibraries) + INSTALL ( TARGETS ${HDF5_CPP_LIB_TARGET} diff --git a/config/cmake/HDFLibMacros.cmake b/config/cmake/HDFLibMacros.cmake index b9c1fbb..7b54c95 100644 --- a/config/cmake/HDFLibMacros.cmake +++ b/config/cmake/HDFLibMacros.cmake @@ -59,8 +59,8 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ) ELSE (MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${JPEG_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -80,7 +80,7 @@ MACRO (EXTERNAL_JPEG_LIBRARY compress_type libtype jpeg_pic) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(jpeg PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${JPEG_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) @@ -173,8 +173,8 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ) ELSE (MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${SZIP_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -194,7 +194,7 @@ MACRO (EXTERNAL_SZIP_LIBRARY compress_type libtype encoding) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(szip PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${SZIP_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) @@ -289,8 +289,8 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ) ELSE (MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" + IMPORTED_IMPLIB "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${ZLIB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}" ) ENDIF (MINGW) ELSE (WIN32) @@ -310,7 +310,7 @@ MACRO (EXTERNAL_ZLIB_LIBRARY compress_type libtype) ELSE (${libtype} MATCHES "SHARED") IF (WIN32 AND NOT MINGW) SET_TARGET_PROPERTIES(zlib PROPERTIES - IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${BLDTYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" + IMPORTED_LOCATION "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/lib${ZLIB_LIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}" IMPORTED_LINK_INTERFACE_LANGUAGES "C" ) ELSE (WIN32 AND NOT MINGW) diff --git a/config/cmake/HDFMacros.cmake b/config/cmake/HDFMacros.cmake index 0d3ab5f..568b3ff 100644 --- a/config/cmake/HDFMacros.cmake +++ b/config/cmake/HDFMacros.cmake @@ -43,6 +43,37 @@ MACRO (TARGET_NAMING target libtype) ENDMACRO (TARGET_NAMING) #------------------------------------------------------------------------------- +MACRO (INSTALL_TARGET_PDB target targetdestination targetcomponent) + IF (WIN32 AND MSVC) + GET_TARGET_PROPERTY (target_name ${target} RELWITHDEBINFO_OUTPUT_NAME) + INSTALL ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + ENDIF (WIN32 AND MSVC) +ENDMACRO (INSTALL_TARGET_PDB) + +#------------------------------------------------------------------------------- +MACRO (INSTALL_PROGRAM_PDB target targetdestination targetcomponent) + IF (WIN32 AND MSVC) + GET_TARGET_PROPERTY (target_name ${target} RELWITHDEBINFO_OUTPUT_NAME) + GET_TARGET_PROPERTY (target_prefix h5dump PREFIX) + INSTALL ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${target_prefix}${target_name}.pdb + DESTINATION + ${targetdestination} + CONFIGURATIONS RelWithDebInfo + COMPONENT ${targetcomponent} + ) + ENDIF (WIN32 AND MSVC) +ENDMACRO (INSTALL_PROGRAM_PDB) + +#------------------------------------------------------------------------------- MACRO (HDF_SET_LIB_OPTIONS libtarget libname libtype) # message (STATUS "${libname} libtype: ${libtype}") IF (${libtype} MATCHES "SHARED") diff --git a/fortran/src/CMakeLists.txt b/fortran/src/CMakeLists.txt index cecbfb6..c0fea8c 100644 --- a/fortran/src/CMakeLists.txt +++ b/fortran/src/CMakeLists.txt @@ -270,6 +270,10 @@ ENDIF (WIN32 AND NOT CYGWIN) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) + INSTALL_TARGET_PDB (${HDF5_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} fortlibraries) + INSTALL ( TARGETS ${HDF5_F90_C_LIB_TARGET} diff --git a/hl/c++/src/CMakeLists.txt b/hl/c++/src/CMakeLists.txt index ad5454d..e0ca0e9 100644 --- a/hl/c++/src/CMakeLists.txt +++ b/hl/c++/src/CMakeLists.txt @@ -36,6 +36,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_CPP_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlcpplibraries) + INSTALL ( TARGETS ${HDF5_HL_CPP_LIB_TARGET} diff --git a/hl/fortran/src/CMakeLists.txt b/hl/fortran/src/CMakeLists.txt index f01c7f8..b6f6d08 100644 --- a/hl/fortran/src/CMakeLists.txt +++ b/hl/fortran/src/CMakeLists.txt @@ -95,6 +95,10 @@ ENDIF (WIN32 AND NOT CYGWIN) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_F90_C_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + INSTALL_TARGET_PDB (${HDF5_HL_F90_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hlfortlibraries) + INSTALL ( TARGETS ${HDF5_HL_F90_C_LIB_TARGET} diff --git a/hl/src/CMakeLists.txt b/hl/src/CMakeLists.txt index f144b94..2df2c23 100644 --- a/hl/src/CMakeLists.txt +++ b/hl/src/CMakeLists.txt @@ -55,6 +55,9 @@ INSTALL ( # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_HL_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} hllibraries) + INSTALL ( TARGETS ${HDF5_HL_LIB_TARGET} diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 33fe11b..de9c50c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -832,6 +832,9 @@ ENDIF (NOT HDF5_INSTALL_NO_DEVELOPMENT) # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} libraries) + INSTALL ( TARGETS ${HDF5_LIB_TARGET} diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index f9e7c12..b56f8c7 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -374,6 +374,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5copy diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 4ac4477..4f46541 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1451,6 +1451,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5diff @@ -1461,6 +1464,9 @@ INSTALL ( ) IF (H5_HAVE_PARALLEL) + + INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS ph5diff diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index ad19ba4..0976bc3 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1757,6 +1757,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5dump diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index 76dcf26..f5dabef 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -261,6 +261,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5import diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index a03d139..4d81d72 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -534,6 +534,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5jam h5unjam diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 0dec21c..4c21eee 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -433,6 +433,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5ls diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index 98d5c5a..b182332 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -898,6 +898,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5repack diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 8c621c9..a9c5d11 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -196,6 +196,9 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5stat diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 837a14e..2367911 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -75,10 +75,26 @@ IF (APPLE) ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) ENDIF (APPLE) +IF (MSVC) + GET_TARGET_PROPERTY (target_name ${HDF5_TOOLS_LIB_TARGET} RELWITHDEBINFO_OUTPUT_NAME) + MESSAGE (STATUS "target_name is ${target_name} with config ${CMAKE_BUILD_TYPE}") + INSTALL ( + FILES + ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb + DESTINATION + ${HDF5_INSTALL_LIB_DIR} + CONFIGURATIONS RelWithDebInfo + COMPONENT toolslibraries + ) + ENDIF (MSVC) + #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- IF (HDF5_EXPORTED_TARGETS) + + INSTALL_TARGET_PDB (${HDF5_TOOLS_LIB_TARGET} ${HDF5_INSTALL_LIB_DIR} toolslibraries) + INSTALL ( TARGETS ${HDF5_TOOLS_LIB_TARGET} diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index 72930c9..b634b47 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -311,6 +311,11 @@ ENDIF (BUILD_TESTING) #----------------------------------------------------------------------------- # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- + +INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL ( TARGETS h5debug h5repart h5mkgrp -- cgit v0.12 From d54152f057ef40e17715f1a43ab6895fa3edc389 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 25 May 2012 08:36:04 -0500 Subject: [svn-r22406] do not need warnings from utility program. --- config/cmake/CTestCustom.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index e708a00..7958f22 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -13,6 +13,7 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION "SZIP.src.*:[ \t]*warning" "POSIX name for this item is deprecated" "disabling jobserver mode" + "config.cmake.xlatefile.c" ) SET (CTEST_CUSTOM_MEMCHECK_IGNORE -- cgit v0.12 From d7bfa3617fefb3d1e0262d8940d687bfa9717667 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 25 May 2012 12:36:01 -0500 Subject: [svn-r22410] reduce compiler warnings reported by CDash for non-critical issues --- config/cmake/CTestCustom.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 7958f22..b54bedc 100755 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -5,15 +5,15 @@ SET (CTEST_CUSTOM_WARNING_EXCEPTION "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning C4090:" "H5detect.c.[0-9]+.[ \t]*:[ \t]*warning:[ \t]*passing argument" "H5detect.c[0-9 \t:]*warning:[ \t]*passing argument" - "H5detect.c[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" - "include/string.h[0-9 \t:]*note:[ \t]*expected .void .. but argument is of type .volatile" - "note:[ \t]*expected .void .. but argument is of type .volatile" + "note.*expected.*void.*but argument is of type.*volatile" "H5Tconv.c[0-9 \t:]*warning:[ \t]*comparison is always false due to limited range of data type" "H5Ztrans.c.[0-9]+.[ \t]*:[ \t]*warning C4244" "SZIP.src.*:[ \t]*warning" "POSIX name for this item is deprecated" "disabling jobserver mode" "config.cmake.xlatefile.c" + "warning.*implicit declaration of function" +# "fpp:[ \t]*warning:[ \t]*cannot remove H5_DEBUG_API - not a predefined macro" ) SET (CTEST_CUSTOM_MEMCHECK_IGNORE -- cgit v0.12 From eb5b8163f93e4694ae834bac6f002f6ef895ffe8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 25 May 2012 12:39:07 -0500 Subject: [svn-r22411] reduce compiler warnings by removing unreferenced variables and adding cast Tested: local linux --- CMakeLists.txt | 2 +- examples/h5_attribute.c | 1 - hl/test/test_lite.c | 1 - test/vfd.c | 3 +-- tools/h5dump/h5dump_ddl.c | 7 +++++-- tools/h5dump/h5dump_xml.c | 3 +-- tools/h5jam/h5jam.c | 4 ++-- tools/h5ls/h5ls.c | 16 +++------------- tools/lib/h5tools.c | 9 +++++---- tools/lib/h5tools_dump.c | 13 ++++++------- 10 files changed, 24 insertions(+), 35 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 02da1a3..08ad6ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -368,7 +368,7 @@ IF (CMAKE_BUILD_TYPE MATCHES Debug) ADD_DEFINITIONS (-Wall) ENDIF (NOT WIN32) ELSE (CMAKE_BUILD_TYPE MATCHES Debug) - ADD_DEFINITIONS (-UH5_DEBUG_API -DNDEBUG) + ADD_DEFINITIONS (-DNDEBUG) OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" OFF) IF (HDF5_ENABLE_TRACE) ADD_DEFINITIONS (-DH5_DEBUG_API ) diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 646b395..0ea0153 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -66,7 +66,6 @@ main (void) unsigned i, j; /* Counters */ char string_out[80]; /* Buffer to read string attribute back */ int point_out; /* Buffer to read scalar attribute back */ - int num_attr; /* Number of attributes */ /* * Data initialization. diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index eb00cd7..3fface8 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -1816,7 +1816,6 @@ static int test_valid_path(void) herr_t status; FILE *fp = NULL; htri_t path_valid; - char path[10]; const char *data_string_in = "test"; TESTING("H5LTpath_valid"); diff --git a/test/vfd.c b/test/vfd.c index f6e9f06..ca354d9 100644 --- a/test/vfd.c +++ b/test/vfd.c @@ -1148,11 +1148,10 @@ test_multi_compat(void) { hid_t file=(-1), fapl, fapl2=(-1), dset=(-1), space=(-1); hid_t access_fapl = -1; - char filename[1024], newname[1024], tmp[1024]; + char newname[1024]; char filename_s[1024], newname_s[1024]; char filename_r[1024], newname_r[1024]; int *fhandle2=NULL, *fhandle=NULL; - hsize_t file_size; H5FD_mem_t mt, memb_map[H5FD_MEM_NTYPES]; hid_t memb_fapl[H5FD_MEM_NTYPES]; haddr_t memb_addr[H5FD_MEM_NTYPES]; diff --git a/tools/h5dump/h5dump_ddl.c b/tools/h5dump/h5dump_ddl.c index b8deaf9..22d2a2b 100644 --- a/tools/h5dump/h5dump_ddl.c +++ b/tools/h5dump/h5dump_ddl.c @@ -1488,15 +1488,18 @@ handle_datasets(hid_t fid, const char *dset, void *data, int pe, const char *dis if(sset) { unsigned int i; + unsigned int ndims; hid_t sid = H5Dget_space(dsetid); - int ndims = H5Sget_simple_extent_ndims(sid); + int ndims_res = H5Sget_simple_extent_ndims(sid); H5Sclose(sid); - if(ndims < 0) { + if(ndims_res < 0) { error_msg("H5Sget_simple_extent_ndims failed\n"); h5tools_setstatus(EXIT_FAILURE); return; } + else + ndims = ndims_res; if(!sset->start.data || !sset->stride.data || !sset->count.data || !sset->block.data) { /* they didn't specify a ``stride'' or ``block''. default to 1 in all diff --git a/tools/h5dump/h5dump_xml.c b/tools/h5dump/h5dump_xml.c index 0c48216..1a29659 100644 --- a/tools/h5dump/h5dump_xml.c +++ b/tools/h5dump/h5dump_xml.c @@ -1781,7 +1781,6 @@ xml_dump_data(hid_t obj_id, int obj_data, struct subset_t UNUSED * sset, int UNU hsize_t nelmts = 1; int ndims; int i; - int depth; int status = -1; int stdindent = COL; /* should be 3 */ void *buf = NULL; @@ -2950,7 +2949,7 @@ xml_print_refs(hid_t did, int source) string_dataformat.do_escape = display_escape; outputformat = &string_dataformat; - for (i = 0; i < ssiz; i++) { + for (i = 0; i < (hsize_t)ssiz; i++) { const char *path = lookup_ref_path(*refbuf); ctx.indent_level++; diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index 981eead..52eb0aa 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -310,7 +310,7 @@ main (int argc, const char *argv[]) leave (EXIT_FAILURE); } - fsize = sbuf.st_size; + fsize = (off_t)sbuf.st_size; h5fid = HDopen(input_file, O_RDONLY, 0); if(h5fid < 0) { @@ -455,7 +455,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, exit (EXIT_FAILURE); } - howmuch = sbuf.st_size; + howmuch = (ssize_t)sbuf.st_size; } else howmuch = limit; diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 2171682..0fc0531 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -1436,13 +1436,13 @@ dump_dataset_values(hid_t dset) info = &outputformat; ctx.indent_level = 2; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; /* Print all the values. */ h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Data:\n"); h5tools_render_element(rawoutstream, info, &ctx, &buffer, &curr_pos, info->line_ncols, 0, 0); ctx.need_prefix = TRUE; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; if (h5tools_dump_dset(rawoutstream, info, &ctx, dset, -1, NULL) < 0) { h5tools_str_reset(&buffer); h5tools_str_append(&buffer, " Unable to print data."); @@ -1619,7 +1619,7 @@ list_attr(hid_t obj, const char *attr_name, const H5A_info_t UNUSED *ainfo, if(H5Aread(attr, p_type, buf) >= 0) { ctx.need_prefix = TRUE; ctx.indent_level = 2; - ctx.cur_column = curr_pos; + ctx.cur_column = (size_t)curr_pos; h5tools_dump_mem(rawoutstream, info, &ctx, attr, p_type, space, buf); } @@ -1672,11 +1672,9 @@ dataset_list1(hid_t dset) H5S_class_t space_type; /* type of dataspace */ int i; hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1753,7 +1751,6 @@ dataset_list2(hid_t dset, const char UNUSED *name) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1921,7 +1918,6 @@ datatype_list2(hid_t type, const char UNUSED *name) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -1962,7 +1958,6 @@ list_obj(const char *name, const H5O_info_t *oinfo, const char *first_seen, void h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2121,7 +2116,6 @@ list_lnk(const char *name, const H5L_info_t *linfo, void *_iter) h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2309,11 +2303,9 @@ visit_obj(hid_t file, const char *oname, iter_t *iter) int retval = 0; H5O_info_t oi; /* Information for object */ hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); @@ -2820,11 +2812,9 @@ main(int argc, const char *argv[]) /* Check the type of link given */ if(H5Lget_info(file, oname, &li, H5P_DEFAULT) < 0) { hsize_t curr_pos = 0; /* total data element position */ - h5tool_link_info_t lnk_info; h5tools_str_t buffer; /* string into which to render */ h5tools_context_t ctx; /* print context */ h5tool_format_t *info = &ls_dataformat; - h5tool_format_t outputformat; HDmemset(&ctx, 0, sizeof(ctx)); HDmemset(&buffer, 0, sizeof(h5tools_str_t)); diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 17639bc..24aa81a 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -1051,6 +1051,7 @@ void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) { int i; + unsigned j; HDassert(ctx->ndims); @@ -1058,8 +1059,8 @@ init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) for (i = (ctx->ndims - 2); i >= 0; i--) { ctx->acc[i] = ctx->acc[i + 1] * dims[i + 1]; } - for (i = 0; i < ctx->ndims; i++) - ctx->pos[i] = 0; + for (j = 0; j < ctx->ndims; j++) + ctx->pos[j] = 0; } /*------------------------------------------------------------------------- @@ -1525,7 +1526,7 @@ render_bin_output_region_data_blocks(hid_t region_id, FILE *stream, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * numelem)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ @@ -1670,7 +1671,7 @@ render_bin_output_region_data_points(hid_t region_space, hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * npoints)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); /* Allocate space for the dimension array */ diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index 20c1c8f..619a413 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -261,7 +261,7 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_context_t *ctx/*in,out*/, unsigned flags, hsize_t nelmts, hid_t type, void *_mem) { - HERR_INIT(int, SUCCEED) + int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */ unsigned char *mem = (unsigned char*) _mem; hsize_t i; /*element counter */ size_t size; /*size of each datum */ @@ -390,7 +390,6 @@ h5tools_dump_simple_data(FILE *stream, const h5tool_format_t *info, hid_t contai h5tools_str_close(&buffer); }/* else bin */ -CATCH return ret_value; } @@ -430,7 +429,7 @@ h5tools_print_region_data_blocks(hid_t region_id, hsize_t numelem; hsize_t numindex; size_t jndx; - int indx; + unsigned indx; int type_size; int ret_value = SUCCEED; hid_t mem_space = -1; @@ -466,7 +465,7 @@ h5tools_print_region_data_blocks(hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * numelem)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)numelem)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate region buffer"); /* Select (x , x , ..., x ) x (y , y , ..., y ) hyperslab for reading memory dataset */ @@ -781,7 +780,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, hsize_t curr_pos = 0; hsize_t total_size[H5S_MAX_RANK]; size_t jndx; - int indx; + unsigned indx; int type_size; int ret_value = SUCCEED; unsigned int region_flags; /* buffer extent flags */ @@ -808,7 +807,7 @@ h5tools_print_region_data_points(hid_t region_space, hid_t region_id, if((type_size = H5Tget_size(type_id)) == 0) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_size failed"); - if((region_buf = HDmalloc(type_size * npoints)) == NULL) + if((region_buf = HDmalloc(type_size * (size_t)npoints)) == NULL) HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not allocate buffer for region"); curr_pos = 0; @@ -1668,7 +1667,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5tool_format_t *info, h5tools_conte hid_t type, hid_t space, void *mem) { HERR_INIT(herr_t, SUCCEED) - int i; /*counters */ + unsigned i; /*counters */ hsize_t nelmts; /*total selected elmts */ ctx->ndims = H5Sget_simple_extent_ndims(space); -- cgit v0.12 From 80955cf2247cf0dcf05664db7cbaf0af1f61a23f Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 27 May 2012 09:34:59 -0500 Subject: [svn-r22413] Snapshot version 1.9 release 119 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 30 insertions(+), 30 deletions(-) diff --git a/README.txt b/README.txt index 837fda3..a3b4179 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.119 currently under development +HDF5 version 1.9.120 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 60d0140..65486da 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 2f415fc..45dfb0e 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 984fcf3..db9383f 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22382 2012-05-20 14:36:03Z hdftest . +# From configure.in Id: configure.in 22390 2012-05-22 20:34:34Z byrn . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.119. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.120. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.119' -PACKAGE_STRING='HDF5 1.9.119' +PACKAGE_VERSION='1.9.120' +PACKAGE_STRING='HDF5 1.9.120' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.119 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.120 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.119:";; + short | recursive ) echo "Configuration of HDF5 1.9.120:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.119 +HDF5 configure 1.9.120 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.119, which was +It was created by HDF5 $as_me 1.9.120, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.119' + VERSION='1.9.120' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.119, which was +This file was extended by HDF5 $as_me 1.9.120, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.119 +HDF5 config.status 1.9.120 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33456,7 +33456,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.119 +HDF5 config.lt 1.9.120 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index dba6f30..de6416a 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.119], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.120], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index f1a8077..db2eb81 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index ed2ea4e..e739758 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 5e435a2..0b4a74f 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index 4396a50..b4eeee0 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index c0eb5dc..1fec8f8 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.119 currently under development +HDF5 version 1.9.120 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index d000650..c514a4f 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 119 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 120 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.119" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.120" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index b4d0465..a422176 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 109 +LT_VERS_REVISION = 110 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 2204937..65f980b 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.119" +#define H5_PACKAGE_STRING "HDF5 1.9.120" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.119" +#define H5_PACKAGE_VERSION "1.9.120" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.119" +#define H5_VERSION "1.9.120" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 8b2ee0f..a7cba8d 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.119" +#define H5_PACKAGE_STRING "HDF5 1.9.120" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.119" +#define H5_PACKAGE_VERSION "1.9.120" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.119" +#define H5_VERSION "1.9.120" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From bf24ca674154bd6200d268e39cf3a13cea5d8dde Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 29 May 2012 09:24:01 -0500 Subject: [svn-r22415] Windows needs monolithic set for CPack (CMake 2.8.6) --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08ad6ab..fbb8e98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -942,6 +942,7 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") SET (CPACK_PACKAGE_RELOCATABLE TRUE) IF (WIN32) + SET (CPACK_MONOLITHIC_INSTALL ON) SET (CPACK_NSIS_CONTACT "help@hdfgroup.org") SET (CPACK_NSIS_MODIFY_PATH ON) SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") -- cgit v0.12 From ed84ad426b86ded29b74b45ef02ec4685d05df6b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 29 May 2012 09:31:09 -0500 Subject: [svn-r22416] Missing ${TEST_FOLDER} path component in test script --- config/cmake/runTest.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/runTest.cmake b/config/cmake/runTest.cmake index 34fac1f..139819f 100644 --- a/config/cmake/runTest.cmake +++ b/config/cmake/runTest.cmake @@ -51,7 +51,7 @@ IF (ERROR_APPEND) ENDIF (ERROR_APPEND) IF (TEST_APPEND) - FILE (APPEND ${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") + FILE (APPEND ${TEST_FOLDER}/${TEST_OUTPUT} "${TEST_APPEND} ${TEST_RESULT}\n") ENDIF (TEST_APPEND) # if the return value is !=${TEST_EXPECT} bail out -- cgit v0.12 From 71c9b82d5e97480f965e857f8c65245d36f09916 Mon Sep 17 00:00:00 2001 From: Jonathan Kim Date: Tue, 29 May 2012 18:03:57 -0500 Subject: [svn-r22419] Purpose: HDFFV-7602 - GMQS: HDF5 command tools: Provide framework for reusable test files among tools Stage2 working for h5diff tool. Description: Update cmake script to fetch test files from any tools to a test directory and run test in organized manner. Also keep the apperance similiar to shell script for better maintainance. Tested: CMake (Windows and jam) --- tools/h5diff/CMakeLists.txt | 519 +++++++++++++++++++++----------------------- 1 file changed, 248 insertions(+), 271 deletions(-) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index 4f46541..a962ceb 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -51,304 +51,278 @@ IF (BUILD_TESTING) # -------------------------------------------------------------------- # Copy all the HDF5 files from the test directory into the source directory # -------------------------------------------------------------------- - SET (HDF5_REFERENCE_FILES - h5diff_10.txt - h5diff_100.txt - #h5diff_101.txt - #h5diff_102.txt - #h5diff_103.txt - #h5diff_104.txt - h5diff_11.txt - h5diff_12.txt - h5diff_13.txt - h5diff_14.txt - h5diff_15.txt - h5diff_16_1.txt - h5diff_16_2.txt - h5diff_16_3.txt - h5diff_17.txt - h5diff_171.txt - h5diff_172.txt - h5diff_18_1.txt - h5diff_18.txt - h5diff_20.txt - h5diff_200.txt - h5diff_201.txt - h5diff_202.txt - h5diff_203.txt - h5diff_204.txt - h5diff_205.txt - h5diff_206.txt - h5diff_207.txt - h5diff_208.txt - h5diff_220.txt - h5diff_221.txt - h5diff_222.txt - h5diff_223.txt - h5diff_224.txt - h5diff_21.txt - h5diff_22.txt - h5diff_23.txt - h5diff_24.txt - h5diff_25.txt - h5diff_26.txt - h5diff_27.txt - h5diff_28.txt - h5diff_300.txt - h5diff_400.txt - h5diff_401.txt - h5diff_402.txt - h5diff_403.txt - h5diff_404.txt - h5diff_405.txt - h5diff_406.txt - h5diff_407.txt - h5diff_408.txt - h5diff_409.txt - h5diff_410.txt - h5diff_411.txt - h5diff_412.txt - h5diff_413.txt - h5diff_414.txt - h5diff_415.txt - h5diff_416.txt - h5diff_417.txt - h5diff_418.txt - h5diff_419.txt - h5diff_420.txt - h5diff_421.txt - h5diff_422.txt - h5diff_423.txt - h5diff_424.txt - h5diff_425.txt - h5diff_450.txt - h5diff_451.txt - h5diff_452.txt - h5diff_453.txt - h5diff_454.txt - h5diff_455.txt - h5diff_456.txt - h5diff_457.txt - h5diff_458.txt - h5diff_459.txt - h5diff_465.txt - h5diff_466.txt - h5diff_467.txt - h5diff_468.txt - h5diff_469.txt - h5diff_471.txt - h5diff_472.txt - h5diff_473.txt - h5diff_474.txt - h5diff_475.txt - h5diff_480.txt - h5diff_481.txt - h5diff_482.txt - h5diff_483.txt - h5diff_484.txt - h5diff_485.txt - h5diff_486.txt - h5diff_487.txt - h5diff_50.txt - h5diff_51.txt - h5diff_52.txt - h5diff_53.txt - h5diff_54.txt - h5diff_55.txt - h5diff_56.txt - h5diff_57.txt - h5diff_58.txt - h5diff_500.txt - h5diff_501.txt - h5diff_502.txt - h5diff_503.txt - h5diff_504.txt - h5diff_505.txt - h5diff_506.txt - h5diff_507.txt - h5diff_508.txt - h5diff_509.txt - h5diff_510.txt - h5diff_511.txt - h5diff_512.txt - h5diff_513.txt - h5diff_514.txt - h5diff_515.txt - h5diff_516.txt - h5diff_517.txt - h5diff_518.txt - h5diff_530.txt - h5diff_540.txt - h5diff_600.txt - h5diff_601.txt - h5diff_603.txt - h5diff_604.txt - h5diff_605.txt - h5diff_606.txt - h5diff_607.txt - h5diff_608.txt - h5diff_609.txt - h5diff_610.txt - h5diff_612.txt - h5diff_613.txt - h5diff_614.txt - h5diff_615.txt - h5diff_616.txt - h5diff_617.txt - h5diff_618.txt - h5diff_619.txt - h5diff_621.txt - h5diff_622.txt - h5diff_623.txt - h5diff_624.txt - h5diff_625.txt - h5diff_626.txt - h5diff_627.txt - h5diff_628.txt - h5diff_629.txt - h5diff_630.txt - h5diff_631.txt - h5diff_640.txt - h5diff_641.txt - h5diff_642.txt - h5diff_643.txt - h5diff_644.txt - h5diff_645.txt - h5diff_646.txt - h5diff_70.txt - h5diff_700.txt - h5diff_701.txt - h5diff_702.txt - h5diff_703.txt - h5diff_704.txt - h5diff_705.txt - h5diff_706.txt - h5diff_707.txt - h5diff_708.txt - h5diff_709.txt - h5diff_710.txt - h5diff_80.txt - h5diff_90.txt + SET (LIST_HDF5_TEST_FILES + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_basic2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_types.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dtypes.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_hyper2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_empty.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_links.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_softlinks.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_linked_softlink.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_src.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_extlink_trg.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_src.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_ext2softlink_trg.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_dset_zero_dim_size2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_danglelinks2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_grp_recurse_ext2-3.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude1-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude2-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_exclude3-2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_comp_vl_strs.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_attr_v_level2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/compounds_array_vlen2.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables1.h5 + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/non_comparables2.h5 ) - SET (HDF5_REFERENCE_TEST_FILES - h5diff_basic1.h5 - h5diff_basic2.h5 - h5diff_types.h5 - h5diff_dtypes.h5 - h5diff_attr1.h5 - h5diff_attr2.h5 - h5diff_dset1.h5 - h5diff_dset2.h5 - h5diff_hyper1.h5 - h5diff_hyper2.h5 - h5diff_empty.h5 - h5diff_links.h5 - h5diff_softlinks.h5 - h5diff_linked_softlink.h5 - h5diff_extlink_src.h5 - h5diff_extlink_trg.h5 - h5diff_ext2softlink_src.h5 - h5diff_ext2softlink_trg.h5 - h5diff_dset_zero_dim_size1.h5 - h5diff_dset_zero_dim_size2.h5 - h5diff_danglelinks1.h5 - h5diff_danglelinks2.h5 - h5diff_grp_recurse1.h5 - h5diff_grp_recurse2.h5 - h5diff_grp_recurse_ext1.h5 - h5diff_grp_recurse_ext2-1.h5 - h5diff_grp_recurse_ext2-2.h5 - h5diff_grp_recurse_ext2-3.h5 - h5diff_exclude1-1.h5 - h5diff_exclude1-2.h5 - h5diff_exclude2-1.h5 - h5diff_exclude2-2.h5 - h5diff_exclude3-1.h5 - h5diff_exclude3-2.h5 - h5diff_comp_vl_strs.h5 - h5diff_attr_v_level1.h5 - h5diff_attr_v_level2.h5 - compounds_array_vlen1.h5 - compounds_array_vlen2.h5 - non_comparables1.h5 - non_comparables2.h5 + + SET (LIST_OTHER_TEST_FILES + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_10.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_100.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_11.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_12.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_13.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_14.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_15.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_1.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_2.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_16_3.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_17.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_171.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_172.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18_1.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_18.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_20.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_200.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_201.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_202.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_203.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_204.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_205.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_206.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_207.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_208.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_220.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_221.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_222.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_223.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_224.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_21.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_22.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_23.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_24.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_25.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_26.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_27.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_28.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_300.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_400.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_401.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_402.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_403.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_404.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_405.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_406.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_407.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_408.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_409.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_410.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_411.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_412.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_413.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_414.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_415.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_416.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_417.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_418.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_419.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_420.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_421.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_422.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_423.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_424.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_425.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_450.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_451.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_452.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_453.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_454.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_455.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_456.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_457.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_458.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_459.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_465.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_466.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_467.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_468.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_469.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_471.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_472.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_473.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_474.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_475.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_480.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_481.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_482.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_483.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_484.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_485.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_486.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_487.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_50.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_51.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_52.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_53.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_54.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_55.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_56.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_57.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_58.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_500.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_501.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_502.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_503.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_504.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_505.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_506.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_507.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_508.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_509.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_510.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_511.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_512.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_513.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_514.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_515.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_516.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_517.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_518.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_530.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_540.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_600.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_601.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_603.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_604.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_605.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_606.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_607.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_608.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_609.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_610.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_612.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_613.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_614.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_615.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_616.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_617.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_618.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_619.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_621.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_622.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_623.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_624.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_625.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_626.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_627.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_628.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_629.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_630.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_631.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_640.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_641.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_642.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_643.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_644.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_645.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_646.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_70.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_700.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_701.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_702.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_703.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_704.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_705.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_706.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_707.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_708.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_709.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_710.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_80.txt + ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_90.txt ) - FOREACH (txt_file ${HDF5_REFERENCE_FILES}) - SET (txtdest "${PROJECT_BINARY_DIR}/${txt_file}") - #MESSAGE (STATUS " Copying ${txt_file}") - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${txt_file} ${txtdest} - ) - ENDFOREACH (txt_file ${HDF5_REFERENCE_FILES}) + # Make testfiles dir under build dir + FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - FOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) - SET (dest "${PROJECT_BINARY_DIR}/${h5_file}") - #MESSAGE (STATUS " Copying ${h5_file}") + # + # copy test files from source to build dir + # + FOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) + GET_FILENAME_COMPONENT(fname "${h5_tstfiles}" NAME) + SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}") + #MESSAGE (STATUS " Copying ${fname}") ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/${h5_file} ${dest} + ARGS -E copy_if_different ${h5_tstfiles} ${dest} ) - ENDFOREACH (h5_file ${HDF5_REFERENCE_TEST_FILES}) + ENDFOREACH (h5_tstfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES}) - IF (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/h5diff_101.txt - ) + # + # Overwrite system dependent files (Windows) + # + IF (WIN32 AND NOT CYGWIN) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt - ) - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/h5diff_103.txt - ) - - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/h5diff_104.txt - ) - ELSE (WIN32 AND NOT CYGWIN) - ADD_CUSTOM_COMMAND ( - TARGET h5diff - POST_BUILD - COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101.txt ${PROJECT_BINARY_DIR}/h5diff_101.txt + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_101w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_101.txt ) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102.txt ${PROJECT_BINARY_DIR}/h5diff_102.txt + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_102w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_102.txt ) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103.txt ${PROJECT_BINARY_DIR}/h5diff_103.txt + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_103w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_103.txt ) ADD_CUSTOM_COMMAND ( TARGET h5diff POST_BUILD COMMAND ${CMAKE_COMMAND} - ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104.txt ${PROJECT_BINARY_DIR}/h5diff_104.txt + ARGS -E copy_if_different ${HDF5_TOOLS_H5DIFF_SOURCE_DIR}/testfiles/h5diff_104w.txt ${PROJECT_BINARY_DIR}/testfiles/h5diff_104.txt ) ENDIF (WIN32 AND NOT CYGWIN) @@ -362,6 +336,7 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5DIFF-${resultfile} COMMAND $ ${ARGN}) + SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") @@ -373,14 +348,14 @@ IF (BUILD_TESTING) ADD_TEST ( NAME H5DIFF-clear-${resultfile}-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.out ${resultfile}.out.err + -E remove ./testfiles/${resultfile}.out ./testfiles/${resultfile}.out.err ) ADD_TEST ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" @@ -398,6 +373,7 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME PH5DIFF-${resultfile} COMMAND $ ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} ${ARGN}) + SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT ${resultcode} STREQUAL "0") SET_TESTS_PROPERTIES (PH5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") ENDIF (NOT ${resultcode} STREQUAL "0") @@ -409,14 +385,14 @@ IF (BUILD_TESTING) ADD_TEST ( NAME PH5DIFF-clear-${resultfile}-objects COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}_p.out ${resultfile}_p.out.err + -E remove ./testfiles/${resultfile}_p.out ./testfiles/${resultfile}_p.out.err ) ADD_TEST ( NAME PH5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=${MPIEXEC};${MPIEXEC_PREFLAGS};${MPIEXEC_NUMPROC_FLAG};${MPIEXEC_MAX_NUMPROCS};${MPIEXEC_POSTFLAGS};$" -D "TEST_ARGS:STRING=${ARGN}" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=P_${resultfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}.txt" @@ -438,7 +414,7 @@ IF (BUILD_TESTING) ADD_TEST ( NAME H5DIFF-clear-${testname}-objects COMMAND ${CMAKE_COMMAND} - -E remove ${testname}.out ${testname}.out.err + -E remove ./testfiles/${testname}.out ./testfiles/${testname}.out.err ) # if there was a previous test IF (NOT "${last_test}" STREQUAL "") @@ -865,6 +841,7 @@ IF (BUILD_TESTING) h5diff_90.out h5diff_90.out.err ) + SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") -- cgit v0.12 From f4990be63538b8941aa9ad0f4fcf4e11a82185cc Mon Sep 17 00:00:00 2001 From: Larry Knox Date: Sat, 2 Jun 2012 13:54:58 -0500 Subject: [svn-r22426] Add examples/README file to be installed with examples. Text file only, but tested with h5committest. --- MANIFEST | 2 +- c++/examples/Makefile.in | 11 ++++++++++- config/examples.am | 12 +++++++++++- configure | 2 +- examples/Makefile.am | 1 + examples/Makefile.in | 14 ++++++++++++-- examples/README | 17 +++++++++++++++++ fortran/examples/Makefile.in | 11 ++++++++++- hl/c++/examples/Makefile.in | 11 ++++++++++- hl/examples/Makefile.in | 11 ++++++++++- hl/fortran/examples/Makefile.in | 11 ++++++++++- 11 files changed, 93 insertions(+), 10 deletions(-) create mode 100644 examples/README diff --git a/MANIFEST b/MANIFEST index 2fc3949..3c90bd8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -138,7 +138,7 @@ ./examples/h5_shared_mesg.c ./examples/ph5example.c ./examples/testh5cc.sh.in - +./examples/README #------------------------------------------------------------------------------ diff --git a/c++/examples/Makefile.in b/c++/examples/Makefile.in index 479747e..9397a27c 100644 --- a/c++/examples/Makefile.in +++ b/c++/examples/Makefile.in @@ -643,7 +643,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -655,6 +655,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -668,6 +674,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/config/examples.am b/config/examples.am index 244e695..9acd719 100644 --- a/config/examples.am +++ b/config/examples.am @@ -32,6 +32,7 @@ ## The source files that the examples use which should be installed. ## INSTALL_SCRIPT_FILES ## INSTALL_TOP_SCRIPT_FILES +## INSTALL_TOP_FILES ## ## EXAMPLEDIR ## The directory into which examples should be installed. @@ -64,7 +65,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -76,6 +77,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -89,6 +96,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/configure b/configure index db9383f..9c64b66 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22390 2012-05-22 20:34:34Z byrn . +# From configure.in Id: configure.in 22413 2012-05-27 14:34:59Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.120. # diff --git a/examples/Makefile.am b/examples/Makefile.am index 9ec6a85..a35d8ca 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -44,6 +44,7 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ INSTALL_SCRIPT_FILES = run-c-ex.sh INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh +INSTALL_TOP_FILES = README # How to build examples, using installed version of h5cc if BUILD_PARALLEL_CONDITIONAL diff --git a/examples/Makefile.in b/examples/Makefile.in index c93ad12..c01afcc 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -54,7 +54,7 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ +DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/run-c-ex.sh.in $(srcdir)/testh5cc.sh.in \ $(top_srcdir)/config/commence.am \ $(top_srcdir)/config/conclude.am \ @@ -382,6 +382,7 @@ INSTALL_FILES = h5_write.c h5_read.c h5_extend_write.c h5_chunk_read.c \ INSTALL_SCRIPT_FILES = run-c-ex.sh INSTALL_TOP_SCRIPT_FILES = run-all-ex.sh +INSTALL_TOP_FILES = README # The external link examples demonstrate how to use paths; they need # directories to be created to do this. @@ -674,7 +675,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -686,6 +687,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -699,6 +706,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/examples/README b/examples/README new file mode 100644 index 0000000..0550b15 --- /dev/null +++ b/examples/README @@ -0,0 +1,17 @@ + HDF5 Examples + +This directory contains example programs for the installed APIs and scripts to +compile and run them. Examples in the c and hl/c subdirectories are always +installed, and those in fortan, hl/fortran, c++ and hl/c++ will be installed +when fortran or c++ are enabled. + +Running the run-all-ex.sh script in this directory will run the scripts and in +turn the examples in all the subdirectories where examples are installed. The +scripts can also be run individually. The appropriate compile scripts in the +bin directory for this install will be used by default to compile and link the +example programs. Note that h5redeploy must be run if these binaries are +copied or extracted in a directory other than the one where they were initially +installed. Compile scripts from other locations can be used by setting an +environment variable prefix to the path of the directory containing the bin +directory with the compile scripts h5cc, h5fc, etc. For example, export +prefix=/usr/local/hdf5 to use h5cc, h5fc, etc. in /usr/local/hdf5/bin. diff --git a/fortran/examples/Makefile.in b/fortran/examples/Makefile.in index 12460f3..410f1e9 100644 --- a/fortran/examples/Makefile.in +++ b/fortran/examples/Makefile.in @@ -683,7 +683,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -695,6 +695,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -708,6 +714,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/hl/c++/examples/Makefile.in b/hl/c++/examples/Makefile.in index acb7c11..dd07bfd 100644 --- a/hl/c++/examples/Makefile.in +++ b/hl/c++/examples/Makefile.in @@ -628,7 +628,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -640,6 +640,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -653,6 +659,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/hl/examples/Makefile.in b/hl/examples/Makefile.in index e79583d..f8b3dd2 100644 --- a/hl/examples/Makefile.in +++ b/hl/examples/Makefile.in @@ -668,7 +668,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -680,6 +680,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -693,6 +699,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi diff --git a/hl/fortran/examples/Makefile.in b/hl/fortran/examples/Makefile.in index 22744ae..e8028aa 100644 --- a/hl/fortran/examples/Makefile.in +++ b/hl/fortran/examples/Makefile.in @@ -631,7 +631,7 @@ install-data-local: uninstall-local: @$(MAKE) $(AM_MAKEFLAGS) uninstall-examples -install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) +install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) @for f in X $(INSTALL_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLEDIR)/. || exit 1); \ @@ -643,6 +643,12 @@ install-examples: $(EXAMPLEDIR) $(INSTALL_FILES) (set -x; $(INSTALL) $$f $(EXAMPLEDIR)/. || exit 1);\ fi; \ done + @for f in X $(INSTALL_TOP_FILES); do \ + if test $$f != X; then \ + (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ + chmod a-x $(EXAMPLETOPDIR)/$$f;\ + fi; \ + done @for f in X $(INSTALL_TOP_SCRIPT_FILES); do \ if test $$f != X; then \ (set -x; $(INSTALL) $(srcdir)/$$f $(EXAMPLETOPDIR)/. || exit 1); \ @@ -656,6 +662,9 @@ uninstall-examples: @if test -n "$(INSTALL_SCRIPT_FILES)" -a -d $(EXAMPLEDIR); then \ set -x; cd $(EXAMPLEDIR) && $(RM) $(INSTALL_SCRIPT_FILES); \ fi + @if test -n "$(INSTALL_TOP_FILES)" -a -d $(EXAMPLETOPDIR); then \ + set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_FILES); \ + fi @if test -n "$(INSTALL_TOP_SCRIPT_FILES)" -a -d $(EXAMPLETOPDIR); then \ set -x; cd $(EXAMPLETOPDIR) && $(RM) $(INSTALL_TOP_SCRIPT_FILES); \ fi -- cgit v0.12 From 64fc9df55b7ae09b18ac159590cb2325d003be34 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 3 Jun 2012 09:29:20 -0500 Subject: [svn-r22427] Snapshot version 1.9 release 120 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 22 +++++++++++----------- configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/README.txt b/README.txt index a3b4179..3a0ddf0 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.120 currently under development +HDF5 version 1.9.121 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 65486da..511c6aa 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 45dfb0e..8f6408a 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 9c64b66..850f232 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Id: configure.in 22413 2012-05-27 14:34:59Z hdftest . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.120. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.121. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.120' -PACKAGE_STRING='HDF5 1.9.120' +PACKAGE_VERSION='1.9.121' +PACKAGE_STRING='HDF5 1.9.121' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.120 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.121 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.120:";; + short | recursive ) echo "Configuration of HDF5 1.9.121:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.120 +HDF5 configure 1.9.121 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.120, which was +It was created by HDF5 $as_me 1.9.121, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.120' + VERSION='1.9.121' cat >>confdefs.h <<_ACEOF @@ -30595,7 +30595,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.120, which was +This file was extended by HDF5 $as_me 1.9.121, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30661,7 +30661,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.120 +HDF5 config.status 1.9.121 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33456,7 +33456,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.120 +HDF5 config.lt 1.9.121 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index de6416a..834757b 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.120], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.121], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index db2eb81..b7d7a6e 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index e739758..0bc6d46 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 0b4a74f..caff13a 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index b4eeee0..b5e8a88 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 1fec8f8..2645737 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.120 currently under development +HDF5 version 1.9.121 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index c514a4f..5bb1b1e 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 120 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 121 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.120" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.121" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index a422176..76ff24a 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 110 +LT_VERS_REVISION = 111 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 65f980b..b4a7496 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.120" +#define H5_PACKAGE_STRING "HDF5 1.9.121" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.120" +#define H5_PACKAGE_VERSION "1.9.121" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.120" +#define H5_VERSION "1.9.121" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index a7cba8d..66bb0eb 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.120" +#define H5_PACKAGE_STRING "HDF5 1.9.121" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.120" +#define H5_PACKAGE_VERSION "1.9.121" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.120" +#define H5_VERSION "1.9.121" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 7b1ea8aa2a75ef8e28c60e79fcba42b44c4e584a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 4 Jun 2012 12:05:02 -0500 Subject: [svn-r22430] CMake and configure synchronization effort. CMake added most tests and options: DEBUGPKG not addressed. Still needed: compiler wrapper scripts Tested: local linux(cmake) and h5committest --- CMakeLists.txt | 25 +- MANIFEST | 2 + config/cmake/ConfigureChecks.cmake | 546 +++++++++++++++++++++++++------------ config/cmake/HDF5CXXTests.cpp | 56 ++++ config/cmake/HDF5Tests.c | 133 ++++++--- config/cmake/HDF5UseFortran.cmake | 5 + config/cmake/cacheinit.cmake | 8 + config/cmake/mccacheinit.cmake | 18 ++ configure | 22 +- configure.in | 16 +- perform/CMakeLists.txt | 48 ++-- src/H5config.h.in | 4 +- 12 files changed, 633 insertions(+), 250 deletions(-) create mode 100644 config/cmake/HDF5CXXTests.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fbb8e98..9ac6f37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -301,6 +301,15 @@ IF (HDF5_ENABLE_COVERAGE) ENDIF (HDF5_ENABLE_COVERAGE) #----------------------------------------------------------------------------- +# Option to indicate using dmalloc +#----------------------------------------------------------------------------- +# OPTION (HDF5_ENABLE_USING_DMALLOC "Indicate that dmalloc is used" OFF) +# IF (HDF5_ENABLE_USING_DMALLOC) +# FIND_PACKAGE (DMALLOC) +# SET (H5_HAVE_DMALLOC DMALLOC_FOUND) +# ENDIF (HDF5_ENABLE_USING_DMALLOC) + +#----------------------------------------------------------------------------- # Option to indicate using a memory checker #----------------------------------------------------------------------------- OPTION (HDF5_ENABLE_USING_MEMCHECKER "Indicate that a memory checker is used" OFF) @@ -359,10 +368,17 @@ IF (CMAKE_BUILD_TYPE MATCHES Debug) -DH5I_DEBUG -DH5HL_DEBUG -DH5HG_DEBUG -DH5G_DEBUG -DH5F_DEBUG -DH5E_DEBUG -DH5D_DEBUG -DH5B_DEBUG -DH5AC_DEBUG -UNDEBUG ) + # Enable tracing of the API OPTION (HDF5_ENABLE_TRACE "Enable API tracing capability" ON) IF (HDF5_ENABLE_TRACE) ADD_DEFINITIONS (-DH5_DEBUG_API ) ENDIF (HDF5_ENABLE_TRACE) + # Enable instrumenting of the library's internal operations + OPTION (HDF5_ENABLE_INSTRUMENT "Instrument The library" OFF) + IF (HDF5_ENABLE_INSTRUMENT) + SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) + ENDIF (HDF5_ENABLE_INSTRUMENT) + MARK_AS_ADVANCED (HDF5_Enable_Instrument) #-- NMake Makefiles will overwhelm the console with warnings if -Wall is used. IF (NOT WIN32) ADD_DEFINITIONS (-Wall) @@ -407,7 +423,7 @@ ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) IF (HDF5_DISABLE_COMPILER_WARNINGS) # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it. + # warning level is given, so remove it.CMAKE_NO_STD_NAMESPACE IF (MSVC) SET (HDF5_WARNINGS_BLOCKED 1) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") @@ -461,6 +477,7 @@ IF (HDF5_ENABLE_PARALLEL) # and once set, they are cached as false and not regenerated SET (CMAKE_REQUIRED_LIBRARIES "${MPI_C_LIBRARIES}" ) CHECK_FUNCTION_EXISTS (MPI_File_get_size H5_HAVE_MPI_GET_SIZE) + SET (H5_MPI_FILE_SET_SIZE_BIG 1) # Used by Fortran + MPI CHECK_SYMBOL_EXISTS (MPI_Comm_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Comm) CHECK_SYMBOL_EXISTS (MPI_Info_c2f "${MPI_C_INCLUDE_PATH}/mpi.h" H5_HAVE_MPI_MULTI_LANG_Info) @@ -475,6 +492,7 @@ IF (H5_HAVE_PARALLEL) ENDIF (MPI_C_LINK_FLAGS) ENDIF (H5_HAVE_PARALLEL) +SET (DEFAULT_API_VERSION "v110") #----------------------------------------------------------------------------- # Option to use 1.6.x API #----------------------------------------------------------------------------- @@ -482,6 +500,7 @@ OPTION (HDF5_USE_16_API_DEFAULT "Use the HDF5 1.6.x API by default" OFF) SET (H5_USE_16_API_DEFAULT 0) IF (HDF5_USE_16_API_DEFAULT) SET (H5_USE_16_API_DEFAULT 1) + SET (DEFAULT_API_VERSION "v16") ENDIF (HDF5_USE_16_API_DEFAULT) #----------------------------------------------------------------------------- @@ -491,6 +510,7 @@ OPTION (HDF5_USE_18_API_DEFAULT "Use the HDF5 1.8.x API by default" OFF) SET (H5_USE_18_API_DEFAULT 0) IF (HDF5_USE_18_API_DEFAULT) SET (H5_USE_18_API_DEFAULT 1) + SET (DEFAULT_API_VERSION "v18") ENDIF (HDF5_USE_18_API_DEFAULT) #----------------------------------------------------------------------------- @@ -749,6 +769,9 @@ IF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") IF (HDF5_ENABLE_PARALLEL) MESSAGE (FATAL " **** Parallel and C++ options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) + IF (CMAKE_NO_STD_NAMESPACE) + SET (H5_NO_STD 1) + ENDIF (CMAKE_NO_STD_NAMESPACE) ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/c++ ${PROJECT_BINARY_DIR}/c++) ENDIF (HDF5_BUILD_CPP_LIB) ENDIF (EXISTS "${HDF5_SOURCE_DIR}/c++" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/c++") diff --git a/MANIFEST b/MANIFEST index 3c90bd8..988a4bd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2219,6 +2219,7 @@ ./config/cmake/FindSZIP.cmake ./config/cmake/ConversionTests.c ./config/cmake/GetTimeOfDayTest.cpp +./config/cmake/HDF5CXXTests.c ./config/cmake/HDF5Tests.c ./config/cmake/xlatefile.c ./config/cmake/CheckTypeSize.cmake @@ -2246,6 +2247,7 @@ ./config/cmake/CPack.cmake ./config/cmake/NSIS.template.in ./config/cmake/NSIS.InstallOptions.ini.in + ./CMakeLists.txt ./CTestConfig.cmake ./c++/CMakeLists.txt diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0a078b6..274434b 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -11,6 +11,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckVariableExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/CheckFortranFunctionExists.cmake) INCLUDE (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) +INCLUDE (${CMAKE_ROOT}/Modules/TestForSTDNamespace.cmake) #----------------------------------------------------------------------------- # Always SET this for now IF we are on an OS X box @@ -37,18 +38,6 @@ ENDIF (HDF5_Enable_Clear_File_Buffers) MARK_AS_ADVANCED (HDF5_Enable_Clear_File_Buffers) #----------------------------------------------------------------------------- -# Option for --enable-instrument -#----------------------------------------------------------------------------- -IF (CMAKE_BUILD_TYPE MATCHES Debug) - SET (HDF5_Enable_Instrument ON) -ENDIF (CMAKE_BUILD_TYPE MATCHES Debug) -OPTION (HDF5_Enable_Instrument "Instrument The library" HDF5_Enable_Instrument) -IF (HDF5_Enable_Instrument) - SET (H5_HAVE_INSTRUMENTED_LIBRARY 1) -ENDIF (HDF5_Enable_Instrument) -MARK_AS_ADVANCED (HDF5_Enable_Instrument) - -#----------------------------------------------------------------------------- # Option for --enable-strict-format-checks #----------------------------------------------------------------------------- OPTION (HDF5_STRICT_FORMAT_CHECKS "Whether to perform strict file format checks" OFF) @@ -153,6 +142,8 @@ ENDIF (WIN32) # Should the Default Virtual File Driver be compiled? # This is hard-coded now but option should added to match configure # +SET (H5_DEFAULT_VFD H5FD_SEC2) + IF (WINDOWS) SET (H5_HAVE_WINDOWS 1) # ---------------------------------------------------------------------- @@ -162,7 +153,6 @@ IF (WINDOWS) SET (H5_HAVE_WINDOW_PATH 1) SET (LINK_LIBS ${LINK_LIBS} "kernel32") ENDIF (WINDOWS) -SET (H5_DEFAULT_VFD H5FD_SEC2) IF (WINDOWS) SET (H5_HAVE_IO_H 1) @@ -210,7 +200,7 @@ ENDIF (CYGWIN) # Check for the math library "m" #----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_LIBRARY_EXISTS_CONCAT ("m" random H5_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) ENDIF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) @@ -231,6 +221,123 @@ ENDIF (WINDOWS) TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) +# For other specific tests, use this MACRO. +MACRO (HDF5_FUNCTION_TEST OTHER_TEST) + IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") + SET (OTHER_TEST_ADD_LIBRARIES) + IF (CMAKE_REQUIRED_LIBRARIES) + SET (OTHER_TEST_ADD_LIBRARIES "-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") + ENDIF (CMAKE_REQUIRED_LIBRARIES) + + FOREACH (def ${HDF5_EXTRA_TEST_DEFINITIONS}) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}=${${def}}") + ENDFOREACH (def) + + FOREACH (def + HAVE_SYS_TIME_H + HAVE_UNISTD_H + HAVE_SYS_TYPES_H + HAVE_SYS_SOCKET_H + ) + IF ("${H5_${def}}") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D${def}") + ENDIF ("${H5_${def}}") + ENDFOREACH (def) + + IF (LARGEFILE) + SET (MACRO_CHECK_FUNCTION_DEFINITIONS + "${MACRO_CHECK_FUNCTION_DEFINITIONS} -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE" + ) + ENDIF (LARGEFILE) + + #MESSAGE (STATUS "Performing ${OTHER_TEST}") + TRY_COMPILE (${OTHER_TEST} + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + "${OTHER_TEST_ADD_LIBRARIES}" + OUTPUT_VARIABLE OUTPUT + ) + IF (${OTHER_TEST}) + SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") + ELSE (${OTHER_TEST}) + MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") + SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "${OUTPUT}\n" + ) + ENDIF (${OTHER_TEST}) + ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +ENDMACRO (HDF5_FUNCTION_TEST) + +#----------------------------------------------------------------------------- +# Check for these functions before the time headers are checked +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (STDC_HEADERS) +ENDIF (NOT WINDOWS) + +CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) +#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) +# Since gettimeofday is not defined any where standard, lets look in all the +# usual places. On MSVC we are just going to use ::clock() +IF (NOT MSVC) + IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") + SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") + + IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY + ${CMAKE_BINARY_DIR} + ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp + COMPILE_DEFINITIONS -DTRY_SYS_TIME_H + OUTPUT_VARIABLE OUTPUT + ) + IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") + SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") + ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") + ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") + + IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) + MESSAGE (STATUS "---------------------------------------------------------------") + MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") + MESSAGE (STATUS " own implementation.. This can happen on older versions of") + MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") + MESSAGE (STATUS " to a newer version such as MinGW 3.12") + MESSAGE (STATUS "---------------------------------------------------------------") + ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) +ENDIF (NOT MSVC) + +# Find the library containing clock_gettime() +IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) + CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) + CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) + IF(CLOCK_GETTIME_IN_LIBC) + SET(H5_HAVE_CLOCK_GETTIME 1) + ELSEIF(CLOCK_GETTIME_IN_LIBRT) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS rt) + ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) + SET(H5_HAVE_CLOCK_GETTIME 1) + LIST(APPEND LINK_LIBS posix4) + ENDIF(CLOCK_GETTIME_IN_LIBC) +ENDIF (NOT WINDOWS) +#----------------------------------------------------------------------------- + #----------------------------------------------------------------------------- # Check IF header file exists and add it to the list. #----------------------------------------------------------------------------- @@ -244,43 +351,17 @@ ENDMACRO (CHECK_INCLUDE_FILE_CONCAT) #----------------------------------------------------------------------------- # Check for the existence of certain header files #----------------------------------------------------------------------------- -CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) -CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) -CHECK_INCLUDE_FILE_CONCAT ("mfhdf.h" H5_HAVE_MFHDF_H) -CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) -CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) -CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) -CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) -CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) -CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) -CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) -CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) CHECK_INCLUDE_FILE_CONCAT ("sys/resource.h" H5_HAVE_SYS_RESOURCE_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) -IF (CMAKE_SYSTEM_NAME MATCHES "OSF") - CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) -ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") - SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) -ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") CHECK_INCLUDE_FILE_CONCAT ("sys/time.h" H5_HAVE_SYS_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) -CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) CHECK_INCLUDE_FILE_CONCAT ("unistd.h" H5_HAVE_UNISTD_H) -CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) -CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) -CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/ioctl.h" H5_HAVE_SYS_IOCTL_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/stat.h" H5_HAVE_SYS_STAT_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/socket.h" H5_HAVE_SYS_SOCKET_H) +CHECK_INCLUDE_FILE_CONCAT ("sys/types.h" H5_HAVE_SYS_TYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("stddef.h" H5_HAVE_STDDEF_H) +CHECK_INCLUDE_FILE_CONCAT ("setjmp.h" H5_HAVE_SETJMP_H) CHECK_INCLUDE_FILE_CONCAT ("features.h" H5_HAVE_FEATURES_H) -CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) -CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) - -IF (NOT CYGWIN) - CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) -ENDIF (NOT CYGWIN) +CHECK_INCLUDE_FILE_CONCAT ("stdint.h" H5_HAVE_STDINT_H) # IF the c compiler found stdint, check the C++ as well. On some systems this # file will be found by C but not C++, only do this test IF the C++ compiler @@ -293,6 +374,37 @@ IF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) ENDIF (NOT H5_HAVE_STDINT_H_CXX) ENDIF (H5_HAVE_STDINT_H AND CMAKE_CXX_COMPILER_LOADED) +# Darwin +CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) + +# Windows +CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) +IF (NOT CYGWIN) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) +ENDIF (NOT CYGWIN) +CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) + +IF (CMAKE_SYSTEM_NAME MATCHES "OSF") + CHECK_INCLUDE_FILE_CONCAT ("sys/sysinfo.h" H5_HAVE_SYS_SYSINFO_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/proc.h" H5_HAVE_SYS_PROC_H) +ELSE (CMAKE_SYSTEM_NAME MATCHES "OSF") + SET (H5_HAVE_SYS_SYSINFO_H "" CACHE INTERNAL "" FORCE) + SET (H5_HAVE_SYS_PROC_H "" CACHE INTERNAL "" FORCE) +ENDIF (CMAKE_SYSTEM_NAME MATCHES "OSF") + +CHECK_INCLUDE_FILE_CONCAT ("globus/common.h" H5_HAVE_GLOBUS_COMMON_H) +CHECK_INCLUDE_FILE_CONCAT ("pdb.h" H5_HAVE_PDB_H) +CHECK_INCLUDE_FILE_CONCAT ("pthread.h" H5_HAVE_PTHREAD_H) +CHECK_INCLUDE_FILE_CONCAT ("srbclient.h" H5_HAVE_SRBCLIENT_H) +CHECK_INCLUDE_FILE_CONCAT ("string.h" H5_HAVE_STRING_H) +CHECK_INCLUDE_FILE_CONCAT ("strings.h" H5_HAVE_STRINGS_H) +CHECK_INCLUDE_FILE_CONCAT ("time.h" H5_HAVE_TIME_H) +CHECK_INCLUDE_FILE_CONCAT ("stdlib.h" H5_HAVE_STDLIB_H) +CHECK_INCLUDE_FILE_CONCAT ("memory.h" H5_HAVE_MEMORY_H) +CHECK_INCLUDE_FILE_CONCAT ("dlfcn.h" H5_HAVE_DLFCN_H) +CHECK_INCLUDE_FILE_CONCAT ("inttypes.h" H5_HAVE_INTTYPES_H) +CHECK_INCLUDE_FILE_CONCAT ("netinet/in.h" H5_HAVE_NETINET_IN_H) + #----------------------------------------------------------------------------- # Check for large file support #----------------------------------------------------------------------------- @@ -303,7 +415,7 @@ SET (LINUX_LFS 0) SET (HDF5_EXTRA_FLAGS) IF (NOT WINDOWS) # Linux Specific flags - SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE -D_BSD_SOURCE) + SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE=199506L -D_BSD_SOURCE) OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) IF (HDF5_ENABLE_LARGE_FILE) SET (msg "Performing TEST_LFS_WORKS") @@ -340,6 +452,28 @@ ENDIF (NOT WINDOWS) ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- +# Check for HAVE_OFF64_T functionality +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (HAVE_OFF64_T) + IF (H5_HAVE_OFF64_T) + CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) + CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) + CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) + CHECK_FUNCTION_EXISTS (ftruncate64 H5_HAVE_FTRUNCATE64) + ENDIF (H5_HAVE_OFF64_T) + + CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) + CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) + + HDF5_FUNCTION_TEST (HAVE_STAT64_STRUCT) + IF (HAVE_STAT64_STRUCT) + CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) + CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) + ENDIF (HAVE_STAT64_STRUCT) +ENDIF (NOT WINDOWS) + +#----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types #----------------------------------------------------------------------------- MACRO (H5_CHECK_TYPE_SIZE type var) @@ -353,7 +487,6 @@ MACRO (H5_CHECK_TYPE_SIZE type var) ENDIF (NOT ${aVar}) ENDMACRO (H5_CHECK_TYPE_SIZE) - H5_CHECK_TYPE_SIZE (char H5_SIZEOF_CHAR) H5_CHECK_TYPE_SIZE (short H5_SIZEOF_SHORT) H5_CHECK_TYPE_SIZE (int H5_SIZEOF_INT) @@ -370,66 +503,115 @@ ENDIF (NOT H5_SIZEOF___INT64) H5_CHECK_TYPE_SIZE (float H5_SIZEOF_FLOAT) H5_CHECK_TYPE_SIZE (double H5_SIZEOF_DOUBLE) H5_CHECK_TYPE_SIZE ("long double" H5_SIZEOF_LONG_DOUBLE) + H5_CHECK_TYPE_SIZE (int8_t H5_SIZEOF_INT8_T) H5_CHECK_TYPE_SIZE (uint8_t H5_SIZEOF_UINT8_T) H5_CHECK_TYPE_SIZE (int_least8_t H5_SIZEOF_INT_LEAST8_T) H5_CHECK_TYPE_SIZE (uint_least8_t H5_SIZEOF_UINT_LEAST8_T) H5_CHECK_TYPE_SIZE (int_fast8_t H5_SIZEOF_INT_FAST8_T) H5_CHECK_TYPE_SIZE (uint_fast8_t H5_SIZEOF_UINT_FAST8_T) + H5_CHECK_TYPE_SIZE (int16_t H5_SIZEOF_INT16_T) H5_CHECK_TYPE_SIZE (uint16_t H5_SIZEOF_UINT16_T) H5_CHECK_TYPE_SIZE (int_least16_t H5_SIZEOF_INT_LEAST16_T) H5_CHECK_TYPE_SIZE (uint_least16_t H5_SIZEOF_UINT_LEAST16_T) H5_CHECK_TYPE_SIZE (int_fast16_t H5_SIZEOF_INT_FAST16_T) H5_CHECK_TYPE_SIZE (uint_fast16_t H5_SIZEOF_UINT_FAST16_T) + H5_CHECK_TYPE_SIZE (int32_t H5_SIZEOF_INT32_T) H5_CHECK_TYPE_SIZE (uint32_t H5_SIZEOF_UINT32_T) H5_CHECK_TYPE_SIZE (int_least32_t H5_SIZEOF_INT_LEAST32_T) H5_CHECK_TYPE_SIZE (uint_least32_t H5_SIZEOF_UINT_LEAST32_T) H5_CHECK_TYPE_SIZE (int_fast32_t H5_SIZEOF_INT_FAST32_T) H5_CHECK_TYPE_SIZE (uint_fast32_t H5_SIZEOF_UINT_FAST32_T) + H5_CHECK_TYPE_SIZE (int64_t H5_SIZEOF_INT64_T) H5_CHECK_TYPE_SIZE (uint64_t H5_SIZEOF_UINT64_T) H5_CHECK_TYPE_SIZE (int_least64_t H5_SIZEOF_INT_LEAST64_T) H5_CHECK_TYPE_SIZE (uint_least64_t H5_SIZEOF_UINT_LEAST64_T) H5_CHECK_TYPE_SIZE (int_fast64_t H5_SIZEOF_INT_FAST64_T) H5_CHECK_TYPE_SIZE (uint_fast64_t H5_SIZEOF_UINT_FAST64_T) + IF (NOT APPLE) H5_CHECK_TYPE_SIZE (size_t H5_SIZEOF_SIZE_T) H5_CHECK_TYPE_SIZE (ssize_t H5_SIZEOF_SSIZE_T) IF (NOT H5_SIZEOF_SSIZE_T) SET (H5_SIZEOF_SSIZE_T 0) ENDIF (NOT H5_SIZEOF_SSIZE_T) + H5_CHECK_TYPE_SIZE (ptrdiff_t H5_SIZEOF_PTRDIFF_T) ENDIF (NOT APPLE) + H5_CHECK_TYPE_SIZE (off_t H5_SIZEOF_OFF_T) H5_CHECK_TYPE_SIZE (off64_t H5_SIZEOF_OFF64_T) IF (NOT H5_SIZEOF_OFF64_T) SET (H5_SIZEOF_OFF64_T 0) ENDIF (NOT H5_SIZEOF_OFF64_T) -# Find the library containing clock_gettime() +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) + +#----------------------------------------------------------------------------- +# Check if the dev_t type is a scalar type +#----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_FUNCTION_EXISTS(clock_gettime CLOCK_GETTIME_IN_LIBC) - CHECK_LIBRARY_EXISTS(rt clock_gettime "" CLOCK_GETTIME_IN_LIBRT) - CHECK_LIBRARY_EXISTS(posix4 clock_gettime "" CLOCK_GETTIME_IN_LIBPOSIX4) - IF(CLOCK_GETTIME_IN_LIBC) - SET(H5_HAVE_CLOCK_GETTIME 1) - ELSEIF(CLOCK_GETTIME_IN_LIBRT) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS rt) - ELSEIF(CLOCK_GETTIME_IN_LIBPOSIX4) - SET(H5_HAVE_CLOCK_GETTIME 1) - LIST(APPEND LINK_LIBS posix4) - ENDIF(CLOCK_GETTIME_IN_LIBC) + HDF5_FUNCTION_TEST (DEV_T_IS_SCALAR) ENDIF (NOT WINDOWS) -# For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) +# ---------------------------------------------------------------------- +# Check for MONOTONIC_TIMER support (used in clock_gettime). This has +# to be done after any POSIX/BSD defines to ensure that the test gets +# the correct POSIX level on linux. +CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) + +#----------------------------------------------------------------------------- +# Check a bunch of time functions +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + FOREACH (test + HAVE_TM_GMTOFF + HAVE___TM_GMTOFF +# HAVE_TIMEZONE + HAVE_STRUCT_TIMEZONE + GETTIMEOFDAY_GIVES_TZ + TIME_WITH_SYS_TIME + HAVE_TM_ZONE + HAVE_STRUCT_TM_TM_ZONE + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) + IF (NOT CYGWIN AND NOT MINGW) + HDF5_FUNCTION_TEST (HAVE_TIMEZONE) +# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + ENDIF (NOT CYGWIN AND NOT MINGW) +ENDIF (NOT WINDOWS) + +# ---------------------------------------------------------------------- +# Does the struct stat have the st_blocks field? This field is not Posix. +# +IF (NOT WINDOWS) + HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) +ENDIF (NOT WINDOWS) + +# ---------------------------------------------------------------------- +# How do we figure out the width of a tty in characters? +# +CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) +CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) +CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) +CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) +HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) +HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) +IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) + CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) + CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) +ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # Check for some functions that are used # CHECK_FUNCTION_EXISTS (alarm H5_HAVE_ALARM) +#CHECK_FUNCTION_EXISTS (BSDgettimeofday H5_HAVE_BSDGETTIMEOFDAY) CHECK_FUNCTION_EXISTS (fork H5_HAVE_FORK) CHECK_FUNCTION_EXISTS (frexpf H5_HAVE_FREXPF) CHECK_FUNCTION_EXISTS (frexpl H5_HAVE_FREXPL) @@ -462,18 +644,13 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) -#CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) -CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) -CHECK_FUNCTION_EXISTS (fseeko H5_HAVE_FSEEKO) -CHECK_FUNCTION_EXISTS (ftello H5_HAVE_FTELLO) -CHECK_FUNCTION_EXISTS (fseeko64 H5_HAVE_FSEEKO64) -CHECK_FUNCTION_EXISTS (ftello64 H5_HAVE_FTELLO64) -CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) -CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) +IF (H5_HAVE_VSNPRINTF) + HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) +ENDIF (H5_HAVE_VSNPRINTF) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro +#----------------------------------------------------------------------------- IF (NOT H5_HAVE_SIGSETJMP) IF (H5_HAVE_SETJMP_H) CHECK_SYMBOL_EXISTS (sigsetjmp "setjmp.h" H5_HAVE_MACRO_SIGSETJMP) @@ -484,71 +661,30 @@ IF (NOT H5_HAVE_SIGSETJMP) ENDIF (NOT H5_HAVE_SIGSETJMP) #----------------------------------------------------------------------------- -# Since gettimeofday is not defined any where standard, lets look in all the -# usual places. On MSVC we are just going to use ::clock() -#----------------------------------------------------------------------------- -IF (NOT MSVC) - IF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - TRY_COMPILE (HAVE_TIME_GETTIMEOFDAY - ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp - COMPILE_DEFINITIONS -DTRY_TIME_H - OUTPUT_VARIABLE OUTPUT - ) - IF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_TIME_GETTIMEOFDAY$") - - IF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - TRY_COMPILE (HAVE_SYS_TIME_GETTIMEOFDAY - ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/GetTimeOfDayTest.cpp - COMPILE_DEFINITIONS -DTRY_SYS_TIME_H - OUTPUT_VARIABLE OUTPUT - ) - IF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - SET (H5_HAVE_SYS_TIME_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_SYS_TIME_GETTIMEOFDAY") - SET (H5_HAVE_GETTIMEOFDAY "1" CACHE INTERNAL "H5_HAVE_GETTIMEOFDAY") - ENDIF (HAVE_SYS_TIME_GETTIMEOFDAY STREQUAL "TRUE") - ENDIF ("H5_HAVE_SYS_TIME_GETTIMEOFDAY" MATCHES "^H5_HAVE_SYS_TIME_GETTIMEOFDAY$") - - IF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) - MESSAGE (STATUS "---------------------------------------------------------------") - MESSAGE (STATUS "Function 'gettimeofday()' was not found. HDF5 will use its") - MESSAGE (STATUS " own implementation.. This can happen on older versions of") - MESSAGE (STATUS " MinGW on Windows. Consider upgrading your MinGW installation") - MESSAGE (STATUS " to a newer version such as MinGW 3.12") - MESSAGE (STATUS "---------------------------------------------------------------") - ENDIF (NOT HAVE_SYS_TIME_GETTIMEOFDAY AND NOT H5_HAVE_GETTIMEOFDAY) -ENDIF (NOT MSVC) - # Check for Symbols CHECK_SYMBOL_EXISTS (tzname "time.h" H5_HAVE_DECL_TZNAME) #----------------------------------------------------------------------------- -# +# Check a bunch of other functions #----------------------------------------------------------------------------- IF (NOT WINDOWS) - CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) - CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) + FOREACH (test + LONE_COLON + HAVE_ATTRIBUTE + HAVE_C99_FUNC + HAVE_FUNCTION + HAVE_C99_DESIGNATED_INITIALIZER + SYSTEM_SCOPE_THREADS + HAVE_SOCKLEN_T + CXX_HAVE_OFFSETOF + ) + HDF5_FUNCTION_TEST (${test}) + ENDFOREACH (test) ENDIF (NOT WINDOWS) -#----------------------------------------------------------------------------- -# Check for the Stream VFD driver -#----------------------------------------------------------------------------- -IF (HDF5_STREAM_VFD) - CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) - CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) - CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) - SET (H5_HAVE_STREAM 1) -ENDIF (HDF5_STREAM_VFD) - - -# For other other specific tests, use this MACRO. -MACRO (HDF5_FUNCTION_TEST OTHER_TEST) - IF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") +# For other CXX specific tests, use this MACRO. +MACRO (HDF5_CXX_FUNCTION_TEST OTHER_TEST) + IF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-D${OTHER_TEST} ${CMAKE_REQUIRED_FLAGS}") SET (OTHER_TEST_ADD_LIBRARIES) IF (CMAKE_REQUIRED_LIBRARIES) @@ -579,61 +715,87 @@ MACRO (HDF5_FUNCTION_TEST OTHER_TEST) #MESSAGE (STATUS "Performing ${OTHER_TEST}") TRY_COMPILE (${OTHER_TEST} ${CMAKE_BINARY_DIR} - ${HDF5_RESOURCES_DIR}/HDF5Tests.c + ${HDF5_RESOURCES_DIR}/HDF5CXXTests.cpp CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} "${OTHER_TEST_ADD_LIBRARIES}" OUTPUT_VARIABLE OUTPUT ) - IF (${OTHER_TEST}) - SET (H5_${OTHER_TEST} 1 CACHE INTERNAL "Other test ${FUNCTION}") - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Success") - ELSE (${OTHER_TEST}) - MESSAGE (STATUS "Performing Other Test ${OTHER_TEST} - Failed") - SET (H5_${OTHER_TEST} "" CACHE INTERNAL "Other test ${FUNCTION}") + IF ("${OTHER_TEST}" EQUAL 0) + SET (${OTHER_TEST} 1 CACHE INTERNAL "CXX test ${FUNCTION}") + MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Success") + ELSE ("${OTHER_TEST}" EQUAL 0) + MESSAGE (STATUS "Performing CXX Test ${OTHER_TEST} - Failed") + SET (${OTHER_TEST} "" CACHE INTERNAL "CXX test ${FUNCTION}") FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log - "Performing Other Test ${OTHER_TEST} failed with the following output:\n" + "Performing CXX Test ${OTHER_TEST} failed with the following output:\n" "${OUTPUT}\n" ) - ENDIF (${OTHER_TEST}) - ENDIF ("H5_${OTHER_TEST}" MATCHES "^H5_${OTHER_TEST}$") -ENDMACRO (HDF5_FUNCTION_TEST) + ENDIF ("${OTHER_TEST}" EQUAL 0) + ENDIF ("${OTHER_TEST}" MATCHES "^${OTHER_TEST}$") +ENDMACRO (HDF5_CXX_FUNCTION_TEST) #----------------------------------------------------------------------------- -# Check a bunch of other functions +# Check a bunch of cxx functions #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +IF (CMAKE_CXX_COMPILER_LOADED) FOREACH (test - TIME_WITH_SYS_TIME - STDC_HEADERS - HAVE_TM_ZONE - HAVE_STRUCT_TM_TM_ZONE - HAVE_ATTRIBUTE - HAVE_FUNCTION - HAVE_TM_GMTOFF -# HAVE_TIMEZONE - HAVE_STRUCT_TIMEZONE - HAVE_STAT_ST_BLOCKS - HAVE_FUNCTION - SYSTEM_SCOPE_THREADS - HAVE_SOCKLEN_T - DEV_T_IS_SCALAR - HAVE_OFF64_T - GETTIMEOFDAY_GIVES_TZ - VSNPRINTF_WORKS - HAVE_C99_FUNC - HAVE_C99_DESIGNATED_INITIALIZER - CXX_HAVE_OFFSETOF - LONE_COLON + OLD_HEADER_FILENAME + H5_NO_NAMESPACE + H5_NO_STD + BOOL_NOTDEFINED + NO_STATIC_CAST ) - HDF5_FUNCTION_TEST (${test}) + HDF5_CXX_FUNCTION_TEST (${test}) ENDFOREACH (test) - IF (NOT CYGWIN AND NOT MINGW) - HDF5_FUNCTION_TEST (HAVE_TIMEZONE) -# HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - ENDIF (NOT CYGWIN AND NOT MINGW) +ENDIF (CMAKE_CXX_COMPILER_LOADED) + +#----------------------------------------------------------------------------- +# Check if Direct I/O driver works +#----------------------------------------------------------------------------- +IF (NOT WINDOWS) + OPTION (HDF5_ENABLE_DIRECT_VFD "Build the Direct I/O Virtual File Driver" ON) + IF (HDF5_ENABLE_DIRECT_VFD) + SET (msg "Performing TEST_DIRECT_VFD_WORKS") + SET (MACRO_CHECK_FUNCTION_DEFINITIONS "-DTEST_DIRECT_VFD_WORKS -D_GNU_SOURCE ${CMAKE_REQUIRED_FLAGS}") + TRY_RUN (TEST_DIRECT_VFD_WORKS_RUN TEST_DIRECT_VFD_WORKS_COMPILE + ${HDF5_BINARY_DIR}/CMake + ${HDF5_RESOURCES_DIR}/HDF5Tests.c + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} + OUTPUT_VARIABLE OUTPUT + ) + IF (TEST_DIRECT_VFD_WORKS_COMPILE) + IF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + HDF5_FUNCTION_TEST (HAVE_DIRECT) + SET (CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_GNU_SOURCE") + ADD_DEFINITIONS ("-D_GNU_SOURCE") + ELSE (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_DIRECT_VFD_WORKS Run failed with the following output and exit code:\n ${OUTPUT}\n" + ) + ENDIF (TEST_DIRECT_VFD_WORKS_RUN MATCHES 0) + ELSE (TEST_DIRECT_VFD_WORKS_COMPILE ) + SET (TEST_DIRECT_VFD_WORKS "" CACHE INTERNAL ${msg}) + MESSAGE (STATUS "${msg}... no") + FILE (APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log + "Test TEST_DIRECT_VFD_WORKS Compile failed with the following output:\n ${OUTPUT}\n" + ) + ENDIF (TEST_DIRECT_VFD_WORKS_COMPILE) + ENDIF (HDF5_ENABLE_DIRECT_VFD) ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- +# Check for the Stream VFD driver +#----------------------------------------------------------------------------- +IF (HDF5_STREAM_VFD) + CHECK_INCLUDE_FILE_CONCAT ("netdb.h" H5_HAVE_NETDB_H) + CHECK_INCLUDE_FILE_CONCAT ("netinet/tcp.h" H5_HAVE_NETINET_TCP_H) + CHECK_INCLUDE_FILE_CONCAT ("sys/filio.h" H5_HAVE_SYS_FILIO_H) + SET (H5_HAVE_STREAM 1) +ENDIF (HDF5_STREAM_VFD) + +#----------------------------------------------------------------------------- # Check if InitOnceExecuteOnce is available #----------------------------------------------------------------------------- IF (WINDOWS) @@ -697,7 +859,6 @@ IF (WINDOWS) ENDIF("${H5_HAVE_IOEO}" MATCHES "^${H5_HAVE_IOEO}$") ENDIF (NOT HDF5_NO_IOEO_TEST) ENDIF (WINDOWS) - #----------------------------------------------------------------------------- # Option to see if GPFS is available on this filesystem --enable-gpfs @@ -712,13 +873,6 @@ ENDIF (HDF5_ENABLE_GPFS) MARK_AS_ADVANCED (HDF5_ENABLE_GPFS) #----------------------------------------------------------------------------- -# Look for 64 bit file stream capability -#----------------------------------------------------------------------------- -IF (HAVE_OFF64_T) - CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) -ENDIF (HAVE_OFF64_T) - -#----------------------------------------------------------------------------- # Determine how 'inline' is used #----------------------------------------------------------------------------- SET (HDF5_EXTRA_TEST_DEFINITIONS INLINE_TEST_INLINE) @@ -949,6 +1103,31 @@ H5ConversionTests (H5_ULLONG_TO_LDOUBLE_PRECISION "Checking IF converting unsign # H5ConversionTests (H5_FP_TO_INTEGER_OVERFLOW_WORKS "Checking IF overflows normally converting floating-point to integer values") # ---------------------------------------------------------------------- +# Set the flag to indicate that the machine is using a special algorithm to convert +# 'long double' to '(unsigned) long' values. (This flag should only be set for +# the IBM Power6 Linux. When the bit sequence of long double is +# 0x4351ccf385ebc8a0bfcc2a3c3d855620, the converted value of (unsigned)long +# is 0x004733ce17af227f, not the same as the library's conversion to 0x004733ce17af2282. +# The machine's conversion gets the correct value. We define the macro and disable +# this kind of test until we figure out what algorithm they use. +# +IF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) + SET (H5_LDOUBLE_TO_LONG_SPECIAL 0 CACHE INTERNAL "Define if your system converts long double to (unsigned) long values with special algorithm") + MESSAGE (STATUS "Checking IF your system converts long double to (unsigned) long values with special algorithm... no") +ENDIF (H5_LDOUBLE_TO_LONG_SPECIAL MATCHES ^H5_LDOUBLE_TO_LONG_SPECIAL$) +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine is using a special algorithm +# to convert some values of '(unsigned) long' to 'long double' values. +# (This flag should be off for all machines, except for IBM Power6 Linux, +# when the bit sequences are 003fff..., 007fff..., 00ffff..., 01ffff..., +# ..., 7fffff..., the compiler uses a unknown algorithm. We define a +# macro and skip the test for now until we know about the algorithm. +# +IF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) + SET (H5_LONG_TO_LDOUBLE_SPECIAL 0 CACHE INTERNAL "Define if your system can convert (unsigned) long to long double values with special algorithm") + MESSAGE (STATUS "Checking IF your system can convert (unsigned) long to long double values with special algorithm... no") +ENDIF (H5_LONG_TO_LDOUBLE_SPECIAL MATCHES ^H5_LONG_TO_LDOUBLE_SPECIAL$) +# ---------------------------------------------------------------------- # Set the flag to indicate that the machine can accurately convert # 'long double' to '(unsigned) long long' values. (This flag should be set for # all machines, except for Mac OS 10.4 and SGI IRIX64 6.5. When the bit sequence @@ -966,6 +1145,19 @@ H5ConversionTests (H5_LDOUBLE_TO_LLONG_ACCURATE "Checking IF correctly convertin # as big as they should be. # H5ConversionTests (H5_LLONG_TO_LDOUBLE_CORRECT "Checking IF correctly converting (unsigned) long long to long double values") +# ---------------------------------------------------------------------- +# Set the flag to indicate that the machine generates bad code +# for the H5V_log2_gen() routine in src/H5Vprivate.h +# (This flag should be set to no for all machines, except for SGI IRIX64, +# where the cache value is set to yes in it's config file) +# +IF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) + SET (H5_BAD_LOG2_CODE_GENERATED 0 CACHE INTERNAL "Define if your system generates wrong code for log2 routine") + MESSAGE (STATUS "Checking IF your system generates wrong code for log2 routine... no") +ENDIF (H5_BAD_LOG2_CODE_GENERATED MATCHES ^H5_BAD_LOG2_CODE_GENERATED$) +# ---------------------------------------------------------------------- +# Check if pointer alignments are enforced +# H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restrictions are strictly enforced") # Define a macro for Cygwin (on XP only) where the compiler has rounding diff --git a/config/cmake/HDF5CXXTests.cpp b/config/cmake/HDF5CXXTests.cpp new file mode 100644 index 0000000..7003cc8 --- /dev/null +++ b/config/cmake/HDF5CXXTests.cpp @@ -0,0 +1,56 @@ + +#ifdef OLD_HEADER_FILENAME + +#include + +int main(void) { return 0; } + +#endif + + +#ifdef H5_NO_NAMESPACE + +namespace H5 { +int fnord; +} + +int main(void) { + using namespace H5; + fnord = 37; + return 0; +} + +#endif + +#ifdef H5_NO_STD + +#include + +using namespace std; + +int main(void) { + string myString("testing namespace std"); + return 0; +} + +#endif + +#ifdef BOOL_NOTDEFINED +int main(void) { + bool flag; + return 0; +} + +#endif + +#ifdef NO_STATIC_CAST + +int main(void) { + float test_float; + int test_int; + test_float = 37.0; + test_int = static_cast (test_float); + return 0; +} + +#endif diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 9c21415..2f69ec8 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -1,38 +1,5 @@ #define SIMPLE_TEST(x) int main(){ x; return 0; } -#ifdef CXX_HAVE_OFFSETOF - #include -#include - -#ifdef FC_DUMMY_MAIN -#ifndef FC_DUMMY_MAIN_EQ_F77 -# ifdef __cplusplus -extern "C" -# endif -int FC_DUMMY_MAIN() -{ return 1;} -#endif -#endif -int -main () -{ - - struct index_st - { - unsigned char type; - unsigned char num; - unsigned int len; - }; - typedef struct index_st index_t; - int x,y; - x = offsetof(struct index_st, len); - y = offsetof(index_t, num) - - ; - return 0; -} -#endif - #ifdef HAVE_C99_DESIGNATED_INITIALIZER #ifdef FC_DUMMY_MAIN @@ -106,7 +73,7 @@ int test_vsnprintf(const char *fmt,...) int main(void) { - exit(test_vsnprintf("%s","A string that is longer than 16 characters")); + return(test_vsnprintf("%s","A string that is longer than 16 characters")); } #endif @@ -215,6 +182,16 @@ SIMPLE_TEST(struct tm tm; tm.tm_gmtoff=0); #endif /* HAVE_TM_GMTOFF */ +#ifdef HAVE___TM_GMTOFF + +#ifdef HAVE_SYS_TIME_H +#include +#endif +#include +SIMPLE_TEST(struct tm tm; tm.__tm_gmtoff=0); + +#endif /* HAVE_TM_GMTOFF */ + #ifdef HAVE_TIMEZONE #ifdef HAVE_SYS_TIME_H @@ -269,10 +246,10 @@ int main(void) if (strcmp(s, "1099511627776") == 0) { printf("PRINTF_LL_WIDTH=[%s]\n", *currentArg); - exit(0); + return 0; } } - exit(1); + return 1; } #endif /* PRINTF_LL_WIDTH */ @@ -288,7 +265,9 @@ int main(void) pthread_attr_init(&attribute); ret=pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM); - exit(ret==0 ? 0 : 1); + if (ret==0) + return 0; + return 1; } #endif /* SYSTEM_SCOPE_THREADS */ @@ -336,6 +315,35 @@ int main() } #endif +#ifdef HAVE_STAT64_STRUCT +#include +#include ], +struct stat64 sb; +int main() +{ + return 0; +} +#endif + +#ifdef TEST_DIRECT_VFD_WORKS +#include +#include +#include +int main(void) +{ + int fid; + if((fid=open("tst_file", O_CREAT | O_TRUNC | O_DIRECT, 0755))<0) + return 1; + close(fid); + remove("tst_file"); + return 0; +} +#endif + +#ifdef HAVE_DIRECT + SIMPLE_TEST(posix_memalign()); +#endif + #ifdef TEST_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE @@ -382,8 +390,8 @@ int main(void) gettimeofday(&tv, &tz); /* Check whether the function returned any value at all */ if(tz.tz_minuteswest == 7777 && tz.tz_dsttime == 7) - exit(1); - else exit (0); + return 1; + else return 0; } #endif @@ -394,6 +402,41 @@ int main(int argc, char * argv) } #endif +#ifdef CXX_HAVE_OFFSETOF + +#include +#include + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus +extern "C" +# endif +int FC_DUMMY_MAIN() +{ return 1;} +#endif +#endif +int +main () +{ + + struct index_st + { + unsigned char type; + unsigned char num; + unsigned int len; + }; + typedef struct index_st index_t; + int x,y; + x = offsetof(struct index_st, len); + y = offsetof(index_t, num) + + ; + return 0; +} + +#endif + #ifdef HAVE_GPFS #include @@ -423,6 +466,18 @@ int main () #endif /* HAVE_IOEO */ +#ifdef HAVE_STRUCT_VIDEOCONFIG + +SIMPLE_TEST(struct videoconfig w; w.numtextcols=0); + +#endif /* HAVE_TM_GMTOFF */ + +#ifdef HAVE_STRUCT_TEXT_INFO + +SIMPLE_TEST(struct text_info w; w.screenwidth=0); + +#endif /* HAVE_TM_GMTOFF */ + #if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) #ifndef __cplusplus diff --git a/config/cmake/HDF5UseFortran.cmake b/config/cmake/HDF5UseFortran.cmake index c1c5acb..323c9ef 100644 --- a/config/cmake/HDF5UseFortran.cmake +++ b/config/cmake/HDF5UseFortran.cmake @@ -114,6 +114,11 @@ CHECK_FORTRAN_FEATURE(iso_c_binding " PROGRAM main USE iso_c_binding + IMPLICIT NONE + TYPE(C_PTR) :: ptr + TYPE(C_FUNPTR) :: funptr + CHARACTER(LEN=80, KIND=c_char), TARGET :: ichr + ptr = C_LOC(ichr(1:1)) END PROGRAM " FORTRAN_HAVE_ISO_C_BINDING diff --git a/config/cmake/cacheinit.cmake b/config/cmake/cacheinit.cmake index 1ab3432..e7dd19f 100755 --- a/config/cmake/cacheinit.cmake +++ b/config/cmake/cacheinit.cmake @@ -20,6 +20,8 @@ SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) +SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) @@ -28,12 +30,18 @@ SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) +SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) +SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) +SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) SET (HDF5_ENABLE_USING_MEMCHECKER OFF CACHE BOOL "Indicate that a memory checker is used" FORCE) diff --git a/config/cmake/mccacheinit.cmake b/config/cmake/mccacheinit.cmake index 10b2824..b472acf 100755 --- a/config/cmake/mccacheinit.cmake +++ b/config/cmake/mccacheinit.cmake @@ -14,10 +14,14 @@ SET (HDF5_BUILD_EXAMPLES ON CACHE BOOL "Build HDF5 Library Examples" FORCE) SET (HDF5_BUILD_FORTRAN ON CACHE BOOL "Build FORTRAN support" FORCE) +SET (HDF5_ENABLE_F2003 OFF CACHE BOOL "Enable FORTRAN 2003 Standard" FORCE) + SET (HDF5_BUILD_HL_LIB ON CACHE BOOL "Build HIGH Level HDF5 Library" FORCE) SET (HDF5_BUILD_TOOLS ON CACHE BOOL "Build HDF5 Tools" FORCE) +SET (HDF5_BUILD_GENERATORS OFF CACHE BOOL "Build Test Generators" FORCE) + SET (HDF5_ENABLE_Z_LIB_SUPPORT ON CACHE BOOL "Enable Zlib Filters" FORCE) SET (HDF5_ENABLE_SZIP_SUPPORT ON CACHE BOOL "Use SZip Filter" FORCE) @@ -26,22 +30,36 @@ SET (HDF5_ENABLE_SZIP_ENCODING ON CACHE BOOL "Use SZip Encoding" FORCE) SET (HDF5_ENABLE_HSIZET ON CACHE BOOL "Enable datasets larger than memory" FORCE) +SET (HDF5_ENABLE_UNSUPPORTED OFF CACHE BOOL "Enable unsupported combinations of configuration options" FORCE) + SET (HDF5_ENABLE_DEPRECATED_SYMBOLS ON CACHE BOOL "Enable deprecated public API symbols" FORCE) +SET (HDF5_ENABLE_DIRECT_VFD OFF CACHE BOOL "Build the Direct I/O Virtual File Driver" FORCE) + SET (HDF5_ENABLE_PARALLEL OFF CACHE BOOL "Enable parallel build (requires MPI)" FORCE) +SET (MPIEXEC_MAX_NUMPROCS "3" CACHE STRING "Minimum number of processes for HDF parallel tests" FORCE) + +SET (HDF5_BUILD_PARALLEL_ALL OFF CACHE BOOL "Build Parallel Programs" FORCE) + SET (HDF5_ENABLE_COVERAGE OFF CACHE BOOL "Enable code coverage for Libraries and Programs" FORCE) SET (HDF5_ENABLE_USING_MEMCHECKER ON CACHE BOOL "Indicate that a memory checker is used" FORCE) SET (HDF5_DISABLE_COMPILER_WARNINGS OFF CACHE BOOL "Disable compiler warnings" FORCE) +SET (HDF5_USE_FOLDERS ON CACHE BOOL "Enable folder grouping of projects in IDEs." FORCE) + SET (HDF5_USE_16_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.6.x API by default" FORCE) +SET (HDF5_USE_18_API_DEFAULT OFF CACHE BOOL "Use the HDF5 1.8.x API by default" FORCE) + SET (HDF5_ENABLE_THREADSAFE OFF CACHE BOOL "(WINDOWS)Enable Threadsafety" FORCE) SET (HDF5_PACKAGE_EXTLIBS OFF CACHE BOOL "(WINDOWS)CPACK - include external libraries" FORCE) +SET (HDF5_NO_PACKAGES OFF CACHE BOOL "CPACK - Disable packaging" FORCE) + SET (HDF5_ALLOW_EXTERNAL_SUPPORT "NO" CACHE STRING "Allow External Library Building" FORCE) SET (ZLIB_SVN_URL "http://svn.hdfgroup.uiuc.edu/zlib/trunk" CACHE STRING "Use ZLib from HDF repository" FORCE) diff --git a/configure b/configure index 850f232..55ecfba 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22413 2012-05-27 14:34:59Z hdftest . +# From configure.in Id: configure.in 22427 2012-06-03 14:29:20Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.121. # @@ -3900,6 +3900,7 @@ elif test $hdf5_cv_host != $host; then as_fn_error $? "config.cache file is invalid" "$LINENO" 5 fi + case $host_os in aix*) host_os_novers=aix @@ -7257,6 +7258,7 @@ done fi + if test -z "$AR"; then for ac_prog in ar xar do @@ -7449,6 +7451,7 @@ $as_echo "none" >&6; } ;; esac + if test "X$HDF_FORTRAN" = "Xyes" ; then ac_ext=${ac_fc_srcext-f} ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5' @@ -7503,6 +7506,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu fi + if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then echo ' shared libraries disabled in parallel' enable_shared="no" @@ -7522,14 +7526,16 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then $as_echo_n "checking if shared Fortran libraries are supported... " >&6; } H5_FORTRAN_SHARED="yes" - case "`uname`" in + + case "`uname`" in Darwin*) H5_FORTRAN_SHARED="no" CHECK_WARN="Shared Fortran libraries not currently supported on Mac." ;; esac - if test "X${H5_FORTRAN_SHARED}" = "Xno"; then + + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 @@ -7569,12 +7575,14 @@ if test "X${HDF_CXX}" = "Xyes" && test "X${enable_shared}" != "Xno"; then $as_echo_n "checking if shared C++ libraries are supported... " >&6; } H5_CXX_SHARED="yes" - if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then + + if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then H5_CXX_SHARED="no" CHECK_WARN="Shared C++ libraries not currently supported with +DD64 flag." fi - if test "X${H5_CXX_SHARED}" = "Xno"; then + + if test "X${H5_CXX_SHARED}" = "Xno"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $CHECK_WARN" >&5 @@ -7606,11 +7614,13 @@ else fi + if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then echo 'adding compiler flag to avoid optimization problem in pgcc' CC="${CC-cc} -Mx,28,0x8" fi + if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then case "`uname`" in CYGWIN*) @@ -22262,7 +22272,7 @@ done ;; *) - for ac_header in io.h winsock.h sys/timeb.h + for ac_header in io.h winsock2.h sys/timeb.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/configure.in b/configure.in index 834757b..3283cc8 100644 --- a/configure.in +++ b/configure.in @@ -251,6 +251,7 @@ dnl CPU dnl dnl If the `OS' ends with a version number then remove it. For instance, dnl `freebsd3.1' would become `freebsd' + case $host_os in aix*) host_os_novers=aix @@ -710,6 +711,7 @@ dnl ---------------------------------------------------------------------- dnl Check which archiving tool to use. This needs to be done before dnl the AM_PROG_LIBTOOL macro. dnl + if test -z "$AR"; then AC_CHECK_PROGS([AR], [ar xar], [:], [$PATH]) fi @@ -850,6 +852,7 @@ dnl Furthermore, the name of the compiler might tell us how to run the dnl resulting executable. For `mpif90' the executable should be run with dnl `mpiexec' from the same directory as mpif90 if it exists. dnl + if test "X$HDF_FORTRAN" = "Xyes" ; then dnl Change to the Fortran 90 language AC_LANG_PUSH(Fortran) @@ -904,6 +907,7 @@ fi dnl ----------------------------------------------------------------------------- dnl If shared libraries are being used with parallel, disable them, unless the dnl user explicity enables them via the '--enable-shared' option. + if test "X${enable_shared}" = "X" -a "X${enable_parallel}" = "Xyes"; then echo ' shared libraries disabled in parallel' enable_shared="no" @@ -918,7 +922,7 @@ fi dnl ---------------------------------------------------------------------- dnl Fortran libraries are not currently supported on Mac. Disable them. -dnl (this is overridable with --enable-unsupported). +dnl this is overridable with '--enable-unsupported'. dnl AC_SUBST([H5_FORTRAN_SHARED]) H5_FORTRAN_SHARED="no" @@ -927,6 +931,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then H5_FORTRAN_SHARED="yes" dnl Disable fortran shared libraries on Mac. (MAM - 03/30/11) + case "`uname`" in Darwin*) H5_FORTRAN_SHARED="no" @@ -935,6 +940,7 @@ if test "X${HDF_FORTRAN}" = "Xyes" && test "X${enable_shared}" != "Xno"; then esac dnl Report results of check(s) + if test "X${H5_FORTRAN_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -965,12 +971,14 @@ if test "X${HDF_CXX}" = "Xyes" && test "X${enable_shared}" != "Xno"; then H5_CXX_SHARED="yes" dnl Disable C++ shared libraries if DD64 flag is being used. + if (echo dummy ${CXX} ${CXXLD} ${CFLAGS} ${CXXFLAGS} ${LDFLAGS} | grep 'DD64') > /dev/null; then H5_CXX_SHARED="no" CHECK_WARN="Shared C++ libraries not currently supported with +DD64 flag." fi dnl Report results of check(s) + if test "X${H5_CXX_SHARED}" = "Xno"; then AC_MSG_RESULT([no]) AC_MSG_WARN([$CHECK_WARN]) @@ -995,6 +1003,7 @@ dnl pgcc version 6.0x have optimization (-O, -O2 or -O3) problem. Detect dnl these versions and add option "-Mx,28,0x8" to the compiler to avoid dnl the problem if optimization is enabled. dnl + if (${CC-cc} -V 2>&1 | grep '^pgcc 6.0') > /dev/null && test "X$enable_production" = "Xyes"; then echo 'adding compiler flag to avoid optimization problem in pgcc' CC="${CC-cc} -Mx,28,0x8" @@ -1003,6 +1012,7 @@ fi dnl ---------------------------------------------------------------------- dnl Shared libraries are not currently supported under Cygwin, so configure dnl disables them unless --enable-unsupported has been supplied by the user. + if test "X${ALLOW_UNSUPPORTED}" != "Xyes"; then case "`uname`" in CYGWIN*) @@ -1063,7 +1073,7 @@ esac dnl ---------------------------------------------------------------------- dnl Some users have reported problems with libtool's use of '-Wl,-rpath' to -dnl link shared libraries in nondefulat directories. Allow users to +dnl link shared libraries in nondefault directories. Allow users to dnl disable embedding the rpath information in the executables and to dnl instead solely rely on the information in LD_LIBRARY_PATH. AC_MSG_CHECKING([if -Wl,-rpath should be used to link shared libs in nondefault directories]) @@ -1277,7 +1287,7 @@ case "`uname`" in AC_CHECK_HEADERS([io.h sys/timeb.h]) ;; *) - AC_CHECK_HEADERS([io.h winsock.h sys/timeb.h]) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; esac diff --git a/perform/CMakeLists.txt b/perform/CMakeLists.txt index 1bcf628..421caba 100644 --- a/perform/CMakeLists.txt +++ b/perform/CMakeLists.txt @@ -110,25 +110,27 @@ IF (H5_HAVE_PARALLEL) SET_TARGET_PROPERTIES (h5perf_alone PROPERTIES FOLDER perform) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) - #-- Adding test for benchpar - SET (benchpar_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c - ) - ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) - TARGET_NAMING (benchpar ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) - - #-- Adding test for mpi-perf - IF (NOT WIN32) - SET (mpi-perf_SRCS - ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c + IF (HDF5_BUILD_PARALLEL_ALL) + #-- Adding test for benchpar + SET (benchpar_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/benchpar.c ) - ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) - TARGET_NAMING (mpi-perf ${LIB_TYPE}) - TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) - SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) - ENDIF (NOT WIN32) + ADD_EXECUTABLE (benchpar ${benchpar_SRCS}) + TARGET_NAMING (benchpar ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (benchpar ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (benchpar PROPERTIES FOLDER perform) + + #-- Adding test for mpi-perf + IF (NOT WIN32) + SET (mpi-perf_SRCS + ${HDF5_PERFORM_SOURCE_DIR}/mpi-perf.c + ) + ADD_EXECUTABLE (mpi-perf ${mpi-perf_SRCS}) + TARGET_NAMING (mpi-perf ${LIB_TYPE}) + TARGET_LINK_LIBRARIES (mpi-perf ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET} ${HDF5_TEST_LIB_TARGET}) + SET_TARGET_PROPERTIES (mpi-perf PROPERTIES FOLDER perform) + ENDIF (NOT WIN32) + ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) @@ -188,9 +190,11 @@ IF (H5_HAVE_PARALLEL) ADD_TEST (NAME PERFORM_h5perf_alone COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) ENDIF (HDF5_BUILD_PERFORM_STANDALONE) -# ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + IF (HDF5_BUILD_PARALLEL_ALL) + ADD_TEST (NAME PERFORM_benchpar COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - IF (NOT WIN32) - ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) - ENDIF (NOT WIN32) + IF (NOT WIN32) + ADD_TEST (NAME PERFORM_mpi-perf COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS} $) + ENDIF (NOT WIN32) + ENDIF (HDF5_BUILD_PARALLEL_ALL) ENDIF (H5_HAVE_PARALLEL) diff --git a/src/H5config.h.in b/src/H5config.h.in index a2059f5..6176b33 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -405,8 +405,8 @@ /* Define if your system has window style path name. */ #undef HAVE_WINDOW_PATH -/* Define to 1 if you have the header file. */ -#undef HAVE_WINSOCK_H +/* Define to 1 if you have the header file. */ +#undef HAVE_WINSOCK2_H /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H -- cgit v0.12 From d419d8a417cf69f6a8a70d70ccf32196774d7486 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 4 Jun 2012 12:41:26 -0500 Subject: [svn-r22431] Extension is cpp! --- MANIFEST | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index 988a4bd..e57cf56 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2219,7 +2219,7 @@ ./config/cmake/FindSZIP.cmake ./config/cmake/ConversionTests.c ./config/cmake/GetTimeOfDayTest.cpp -./config/cmake/HDF5CXXTests.c +./config/cmake/HDF5CXXTests.cpp ./config/cmake/HDF5Tests.c ./config/cmake/xlatefile.c ./config/cmake/CheckTypeSize.cmake -- cgit v0.12 From 65bf87c4a6ed88ba79ced745400245c2486b4283 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 4 Jun 2012 15:14:59 -0500 Subject: [svn-r22432] Description: Correct misspelled debugging #ifdef and remove unused variable. Tested on: Mac OS X/64 10.7.4 (amazon) w/serial (too minor to require h5committest) --- src/H5F.c | 1 - src/H5MFaggr.c | 22 +++++++++++----------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/H5F.c b/src/H5F.c index cdf418b..e1a9858 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -522,7 +522,6 @@ H5F_get_objects(const H5F_t *f, unsigned types, size_t max_index, hid_t *obj_id_ { size_t obj_id_count=0; /* Number of open IDs */ H5F_olist_t olist; /* Structure to hold search results */ - htri_t type_exists; /* Whether objects of a type are open */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index 05a9241..b3a06ff 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -462,7 +462,7 @@ H5MF_aggr_can_absorb(const H5F_t *f, const H5F_blk_aggr_t *aggr, || H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)) { #ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: section {%a, %Hu} adjoins aggr = {%a, %Hu}\n", "H5MF_aggr_can_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Check if aggregator would get too large and should be absorbed into section */ if((aggr->size + sect->sect_info.size) >= aggr->alloc_size) *shrink = H5MF_SHRINK_SECT_ABSORB_AGGR; @@ -510,9 +510,9 @@ H5MF_aggr_absorb(const H5F_t UNUSED *f, H5F_blk_aggr_t *aggr, H5MF_free_section_ if((aggr->size + sect->sect_info.size) >= aggr->alloc_size && allow_sect_absorb) { /* Check if the section adjoins the beginning or end of the aggregator */ if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) { -#ifdef H5MF_AGGR_DBEUG +#ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Absorb aggregator onto end of section */ sect->sect_info.size += aggr->size; } /* end if */ @@ -520,9 +520,9 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins front of section = {%a, %Hu}\n", " /* Sanity check */ HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); -#ifdef H5MF_AGGR_DBEUG +#ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5MF_aggr_absorb", aggr->addr, aggr->size, sect->sect_info.addr, sect->sect_info.size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Absorb aggregator onto beginning of section */ sect->sect_info.addr -= aggr->size; sect->sect_info.size += aggr->size; @@ -536,9 +536,9 @@ HDfprintf(stderr, "%s: aggr {%a, %Hu} adjoins end of section = {%a, %Hu}\n", "H5 else { /* Check if the section adjoins the beginning or end of the aggregator */ if(H5F_addr_eq((sect->sect_info.addr + sect->sect_info.size), aggr->addr)) { -#ifdef H5MF_AGGR_DBEUG +#ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Absorb section onto front of aggregator */ aggr->addr -= sect->sect_info.size; aggr->size += sect->sect_info.size; @@ -552,9 +552,9 @@ HDfprintf(stderr, "%s: section {%a, %Hu} adjoins front of aggr = {%a, %Hu}\n", " /* Sanity check */ HDassert(H5F_addr_eq((aggr->addr + aggr->size), sect->sect_info.addr)); -#ifdef H5MF_AGGR_DBEUG +#ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: section {%a, %Hu} adjoins end of aggr = {%a, %Hu}\n", "H5MF_aggr_absorb", sect->sect_info.addr, sect->sect_info.size, aggr->addr, aggr->size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Absorb section onto end of aggregator */ aggr->size += sect->sect_info.size; } /* end if */ @@ -637,9 +637,9 @@ H5MF_aggr_reset(H5F_t *f, hid_t dxpl_id, H5F_blk_aggr_t *aggr) /* Retain aggregator info */ tmp_addr = aggr->addr; tmp_size = aggr->size; -#ifdef H5MF_AGGR_DBEUG +#ifdef H5MF_AGGR_DEBUG HDfprintf(stderr, "%s: tmp_addr = %a, tmp_size = %Hu\n", FUNC, tmp_addr, tmp_size); -#endif /* H5MF_AGGR_DBEUG */ +#endif /* H5MF_AGGR_DEBUG */ /* Reset aggregator block information */ aggr->tot_size = 0; -- cgit v0.12 From a11a6d9b34f9317a28e62282dae20a745a845bff Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 5 Jun 2012 14:36:41 -0500 Subject: [svn-r22437] Correct Windows cmake config files Tested: windows --- config/cmake/ConfigureChecks.cmake | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 274434b..60ba6a7 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -123,6 +123,8 @@ IF (WIN32) SET (WINDOWS 1) # MinGW tries to imitate Windows ENDIF (MINGW) SET (H5_HAVE_WIN32_API 1) + SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") + SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) IF (MSVC) @@ -151,7 +153,7 @@ IF (WINDOWS) # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) SET (H5_HAVE_WINDOW_PATH 1) - SET (LINK_LIBS ${LINK_LIBS} "kernel32") +# SET (LINK_LIBS ${LINK_LIBS} "kernel32") ENDIF (WINDOWS) IF (WINDOWS) @@ -177,6 +179,9 @@ IF (WINDOWS) SET (H5_HAVE_TIMEZONE 1) SET (H5_HAVE_GETTIMEOFDAY 1) SET (H5_LONE_COLON 0) + + SET (H5_HAVE_LIBWS2_32 1) + SET (H5_HAVE_LIBWSOCK32 1) ENDIF (WINDOWS) #----------------------------------------------------------------------------- @@ -201,10 +206,10 @@ ENDIF (CYGWIN) #----------------------------------------------------------------------------- IF (NOT WINDOWS) CHECK_LIBRARY_EXISTS_CONCAT ("m" ceil H5_HAVE_LIBM) + CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) + CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) ENDIF (NOT WINDOWS) -CHECK_LIBRARY_EXISTS_CONCAT ("ws2_32" WSAStartup H5_HAVE_LIBWS2_32) -CHECK_LIBRARY_EXISTS_CONCAT ("wsock32" gethostbyname H5_HAVE_LIBWSOCK32) CHECK_LIBRARY_EXISTS_CONCAT ("ucb" gethostname H5_HAVE_LIBUCB) CHECK_LIBRARY_EXISTS_CONCAT ("socket" connect H5_HAVE_LIBSOCKET) CHECK_LIBRARY_EXISTS ("c" gethostbyname "" NOT_NEED_LIBNSL) @@ -213,6 +218,8 @@ IF (NOT NOT_NEED_LIBNSL) CHECK_LIBRARY_EXISTS_CONCAT ("nsl" gethostbyname H5_HAVE_LIBNSL) ENDIF (NOT NOT_NEED_LIBNSL) +# For other tests to use the same libraries +SET (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${LINK_LIBS}) SET (USE_INCLUDES "") IF (WINDOWS) @@ -547,9 +554,6 @@ IF (NOT H5_SIZEOF_OFF64_T) SET (H5_SIZEOF_OFF64_T 0) ENDIF (NOT H5_SIZEOF_OFF64_T) -# For other tests to use the same libraries -SET (CMAKE_REQUIRED_LIBRARIES ${LINK_LIBS}) - #----------------------------------------------------------------------------- # Check if the dev_t type is a scalar type #----------------------------------------------------------------------------- @@ -1164,4 +1168,19 @@ H5ConversionTests (H5_NO_ALIGNMENT_RESTRICTIONS "Checking IF alignment restricti # problem converting from unsigned long long to long double */ IF (CYGWIN) SET (H5_CYGWIN_ULLONG_TO_LDOUBLE_ROUND_PROBLEM 1) -ENDIF (CYGWIN) \ No newline at end of file +ENDIF (CYGWIN) + +# ----------------------------------------------------------------------- +# wrapper script variables +# +SET (prefix ${CMAKE_INSTALL_PREFIX}) +SET (exec_prefix "\${prefix}") +SET (libdir "${exec_prefix}/lib") +SET (includedir "\${prefix}/include") +SET (host_os ${CMAKE_HOST_SYSTEM_NAME}) +SET (CC ${CMAKE_C_COMPILER}) +SET (CXX ${CMAKE_CXX_COMPILER}) +SET (FC ${CMAKE_Fortran_COMPILER}) +FOREACH (LINK_LIB ${LINK_LIBS}) + SET (LIBS "${LIBS} -l${LINK_LIB}") +ENDFOREACH (LINK_LIB ${LINK_LIBS}) -- cgit v0.12 From a6d41f7a75a8f16e6e0efbcf5efc428299c85483 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 6 Jun 2012 17:11:07 -0500 Subject: [svn-r22441] Move some tests into NOT WINDOWS blocks --- config/cmake/ConfigureChecks.cmake | 41 ++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 60ba6a7..4a2daf2 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -554,23 +554,21 @@ IF (NOT H5_SIZEOF_OFF64_T) SET (H5_SIZEOF_OFF64_T 0) ENDIF (NOT H5_SIZEOF_OFF64_T) -#----------------------------------------------------------------------------- -# Check if the dev_t type is a scalar type -#----------------------------------------------------------------------------- IF (NOT WINDOWS) + #----------------------------------------------------------------------------- + # Check if the dev_t type is a scalar type + #----------------------------------------------------------------------------- HDF5_FUNCTION_TEST (DEV_T_IS_SCALAR) -ENDIF (NOT WINDOWS) - -# ---------------------------------------------------------------------- -# Check for MONOTONIC_TIMER support (used in clock_gettime). This has -# to be done after any POSIX/BSD defines to ensure that the test gets -# the correct POSIX level on linux. -CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) -#----------------------------------------------------------------------------- -# Check a bunch of time functions -#----------------------------------------------------------------------------- -IF (NOT WINDOWS) + # ---------------------------------------------------------------------- + # Check for MONOTONIC_TIMER support (used in clock_gettime). This has + # to be done after any POSIX/BSD defines to ensure that the test gets + # the correct POSIX level on linux. + CHECK_VARIABLE_EXISTS (CLOCK_MONOTONIC HAVE_CLOCK_MONOTONIC) + + #----------------------------------------------------------------------------- + # Check a bunch of time functions + #----------------------------------------------------------------------------- FOREACH (test HAVE_TM_GMTOFF HAVE___TM_GMTOFF @@ -587,25 +585,24 @@ IF (NOT WINDOWS) HDF5_FUNCTION_TEST (HAVE_TIMEZONE) # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) ENDIF (NOT CYGWIN AND NOT MINGW) -ENDIF (NOT WINDOWS) -# ---------------------------------------------------------------------- -# Does the struct stat have the st_blocks field? This field is not Posix. -# -IF (NOT WINDOWS) + # ---------------------------------------------------------------------- + # Does the struct stat have the st_blocks field? This field is not Posix. + # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) + ENDIF (NOT WINDOWS) # ---------------------------------------------------------------------- # How do we figure out the width of a tty in characters? # -CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) -CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) -CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) IF (NOT WINDOWS) + CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) + CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) + CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) CHECK_FUNCTION_EXISTS (GetConsoleScreenBufferInfo H5_HAVE_GETCONSOLESCREENBUFFERINFO) CHECK_SYMBOL_EXISTS (TIOCGWINSZ "sys/ioctl.h" H5_HAVE_TIOCGWINSZ) CHECK_SYMBOL_EXISTS (TIOCGETD "sys/ioctl.h" H5_HAVE_TIOCGETD) -- cgit v0.12 From 73db2056a31348fa4c0b14898c5ba66ab214021f Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 7 Jun 2012 11:04:56 -0500 Subject: [svn-r22444] (1) fix for making MEM_GHEAP as MEM_DRAW (2) fix to extend into the aggregator based on threshold (3) fix for the "flavor" logging problem (4) fix for test failures due to the above fixes (5) bug fix for h5stat when h5stat against a non-existing file --- MANIFEST | 1 + src/H5FDlog.c | 19 +++- src/H5FDmulti.c | 3 +- src/H5FDpublic.h | 2 +- src/H5Faccum.c | 27 +++-- src/H5MF.c | 20 +++- src/H5MFaggr.c | 93 ++++++++++----- test/mf.c | 50 +++++++-- tools/h5copy/testfiles/h5copy_ref.out.ls | 2 +- tools/h5copy/testfiles/h5copytst.out.ls | 174 ++++++++++++++--------------- tools/h5stat/h5stat.c | 39 ++----- tools/h5stat/testfiles/h5stat_notexist.ddl | 5 + tools/h5stat/testh5stat.sh.in | 3 + 13 files changed, 266 insertions(+), 172 deletions(-) create mode 100644 tools/h5stat/testfiles/h5stat_notexist.ddl diff --git a/MANIFEST b/MANIFEST index e57cf56..a63581d 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1276,6 +1276,7 @@ ./tools/h5stat/testfiles/h5stat_newgrat-UA.ddl ./tools/h5stat/testfiles/h5stat_newgrat-UG.ddl ./tools/h5stat/testfiles/h5stat_newgrat.h5 +./tools/h5stat/testfiles/h5stat_notexist.ddl ./tools/h5stat/testfiles/h5stat_tsohm.ddl ./tools/h5stat/testfiles/h5stat_tsohm.h5 diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 0b5c677..b2c6398 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -1022,12 +1022,29 @@ H5FD_log_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) *------------------------------------------------------------------------- */ static herr_t -H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t UNUSED type, haddr_t addr) +H5FD_log_set_eoa(H5FD_t *_file, H5FD_mem_t type, haddr_t addr) { H5FD_log_t *file = (H5FD_log_t *)_file; FUNC_ENTER_NOAPI_NOINIT_NOERR + if(file->fa.flags != 0) { + if(H5F_addr_gt(addr, file->eoa) && H5F_addr_gt(addr, 0)) { + hsize_t size = addr - file->eoa; + + /* Retain the flavor of the space allocated by the extension */ + if(file->fa.flags & H5FD_LOG_FLAVOR) { + HDassert(addr < file->iosize); + H5_CHECK_OVERFLOW(size, hsize_t, size_t); + HDmemset(&file->flavor[file->eoa], (int)type, (size_t)size); + } /* end if */ + + /* Log the extension like an allocation */ + if(file->fa.flags & H5FD_LOG_ALLOC) + HDfprintf(file->logfp, "%10a-%10a (%10Hu bytes) (%s) Allocated\n", file->eoa, addr, size, flavors[type]); + } /* end if */ + } /* end if */ + file->eoa = addr; FUNC_LEAVE_NOAPI(SUCCEED) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 5751596..b1d312f 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -309,7 +309,8 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, /* Initialize */ ALL_MEMBERS(mt) { - memb_map[mt] = (H5FD_MEM_DRAW==mt?mt:H5FD_MEM_SUPER); + /* Treat global heap as raw data, not metadata */ + memb_map[mt] = ((mt == H5FD_MEM_DRAW || mt == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : H5FD_MEM_SUPER); memb_fapl[mt] = -1; memb_name[mt] = NULL; memb_addr[mt] = HADDR_UNDEF; diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index ab19c68..5f70f71 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -133,7 +133,7 @@ typedef enum H5F_mem_t H5FD_mem_t; H5FD_MEM_SUPER, /*super*/ \ H5FD_MEM_SUPER, /*btree*/ \ H5FD_MEM_DRAW, /*draw*/ \ - H5FD_MEM_SUPER, /*gheap*/ \ + H5FD_MEM_DRAW, /*gheap*/ \ H5FD_MEM_SUPER, /*lheap*/ \ H5FD_MEM_SUPER /*ohdr*/ \ } diff --git a/src/H5Faccum.c b/src/H5Faccum.c index 3c72c5d..0e549fa 100644 --- a/src/H5Faccum.c +++ b/src/H5Faccum.c @@ -115,6 +115,7 @@ herr_t H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, size_t size, void *buf/*out*/) { + H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -123,8 +124,11 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, HDassert(f->shared); HDassert(buf); + /* Treat global heap as raw data */ + map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; + /* Check if this information is in the metadata accumulator */ - if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ HDassert(!f->shared->accum.buf || (f->shared->accum.alloc_size >= f->shared->accum.size)); @@ -173,7 +177,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, f->shared->accum.dirty_off += amount_before; /* Dispatch to driver */ - if(H5FD_read(f->shared->lf, dxpl_id, type, addr, amount_before, f->shared->accum.buf) < 0) + if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, amount_before, f->shared->accum.buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ else @@ -187,7 +191,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, H5_ASSIGN_OVERFLOW(amount_after, ((addr + size) - (f->shared->accum.loc + f->shared->accum.size)), hsize_t, size_t); /* Dispatch to driver */ - if(H5FD_read(f->shared->lf, dxpl_id, type, (f->shared->accum.loc + f->shared->accum.size), amount_after, (f->shared->accum.buf + f->shared->accum.size + amount_before)) < 0) + if(H5FD_read(f->shared->lf, dxpl_id, map_type, (f->shared->accum.loc + f->shared->accum.size), amount_after, (f->shared->accum.buf + f->shared->accum.size + amount_before)) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end if */ @@ -201,13 +205,13 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, /* Current read doesn't overlap with metadata accumulator, read it from file */ else { /* Dispatch to driver */ - if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0) + if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ } /* end if */ else { /* Read the data */ - if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0) + if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") /* Check for overlap w/dirty accumulator */ @@ -250,7 +254,7 @@ H5F_accum_read(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, } /* end if */ else { /* Read the data */ - if(H5FD_read(f->shared->lf, dxpl_id, type, addr, size, buf) < 0) + if(H5FD_read(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "driver read request failed") } /* end else */ @@ -415,6 +419,7 @@ herr_t H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, size_t size, const void *buf) { + H5FD_mem_t map_type; /* Mapped memory type */ herr_t ret_value = SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -424,8 +429,11 @@ H5F_accum_write(const H5F_t *f, hid_t dxpl_id, H5FD_mem_t type, haddr_t addr, HDassert(f->intent & H5F_ACC_RDWR); HDassert(buf); + /* Treat global heap as raw data */ + map_type = (type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : type; + /* Check for accumulating metadata */ - if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && type != H5FD_MEM_DRAW) { + if((f->shared->feature_flags & H5FD_FEAT_ACCUMULATE_METADATA) && map_type != H5FD_MEM_DRAW) { if(size < H5F_ACCUM_MAX_SIZE) { /* Sanity check */ HDassert(!f->shared->accum.buf || (f->shared->accum.alloc_size >= f->shared->accum.size)); @@ -719,7 +727,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size)); } /* end if */ else { /* Write the data */ - if(H5FD_write(f->shared->lf, dxpl_id, type, addr, size, buf) < 0) + if(H5FD_write(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") /* Check for overlap w/accumulator */ @@ -804,7 +812,7 @@ HDmemset(f->shared->accum.buf + size, 0, (f->shared->accum.alloc_size - size)); } /* end if */ else { /* Write the data */ - if(H5FD_write(f->shared->lf, dxpl_id, type, addr, size, buf) < 0) + if(H5FD_write(f->shared->lf, dxpl_id, map_type, addr, size, buf) < 0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed") } /* end else */ @@ -846,6 +854,7 @@ H5F_accum_free(H5F_t *f, hid_t dxpl_id, H5FD_mem_t UNUSED type, haddr_t addr, /* Sanity check */ /* (The metadata accumulator should not intersect w/raw data */ HDassert(H5FD_MEM_DRAW != type); + HDassert(H5FD_MEM_GHEAP != type); /* (global heap data is being treated as raw data currently) */ /* Check for overlapping the beginning of the accumulator */ if(H5F_addr_le(addr, f->shared->accum.loc)) { diff --git a/src/H5MF.c b/src/H5MF.c index f9ca256..5b4505f 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -160,7 +160,8 @@ H5MF_init_merge_flags(H5F_t *f) all_metadata_same = TRUE; for(type = H5FD_MEM_SUPER; type < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t, type)) /* Skip checking raw data free list mapping */ - if(type != H5FD_MEM_DRAW) { + /* (global heap is treated as raw data) */ + if(type != H5FD_MEM_DRAW && type != H5FD_MEM_GHEAP) { /* Check for any different type mappings */ if(f->shared->fs_type_map[type] != f->shared->fs_type_map[H5FD_MEM_SUPER]) { all_metadata_same = FALSE; @@ -183,9 +184,12 @@ H5MF_init_merge_flags(H5F_t *f) HDmemset(f->shared->fs_aggr_merge, 0, sizeof(f->shared->fs_aggr_merge)); /* Check if merging raw data should be allowed */ + /* (treat global heaps as raw data) */ if(H5FD_MEM_DRAW == f->shared->fs_type_map[H5FD_MEM_DRAW] || - H5FD_MEM_DEFAULT == f->shared->fs_type_map[H5FD_MEM_DRAW]) + H5FD_MEM_DEFAULT == f->shared->fs_type_map[H5FD_MEM_DRAW]) { f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA; + f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA; + } /* end if */ break; case H5MF_AGGR_MERGE_DICHOTOMY: @@ -193,7 +197,9 @@ H5MF_init_merge_flags(H5F_t *f) HDmemset(f->shared->fs_aggr_merge, H5F_FS_MERGE_METADATA, sizeof(f->shared->fs_aggr_merge)); /* Allow merging raw data allocations together */ + /* (treat global heaps as raw data) */ f->shared->fs_aggr_merge[H5FD_MEM_DRAW] = H5F_FS_MERGE_RAWDATA; + f->shared->fs_aggr_merge[H5FD_MEM_GHEAP] = H5F_FS_MERGE_RAWDATA; break; case H5MF_AGGR_MERGE_TOGETHER: @@ -744,6 +750,7 @@ H5MF_try_extend(H5F_t *f, hid_t dxpl_id, H5FD_mem_t alloc_type, haddr_t addr, hsize_t size, hsize_t extra_requested) { haddr_t end; /* End of block to extend */ + H5FD_mem_t map_type; /* Mapped type */ htri_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(FAIL) @@ -755,18 +762,21 @@ HDfprintf(stderr, "%s: Entering: alloc_type = %u, addr = %a, size = %Hu, extra_r HDassert(f); HDassert(H5F_INTENT(f) & H5F_ACC_RDWR); + /* Set mapped type, treating global heap as raw data */ + map_type = (alloc_type == H5FD_MEM_GHEAP) ? H5FD_MEM_DRAW : alloc_type; + /* Compute end of block to extend */ end = addr + size; /* Check if the block is exactly at the end of the file */ - if((ret_value = H5FD_try_extend(f->shared->lf, alloc_type, f, end, extra_requested)) < 0) + if((ret_value = H5FD_try_extend(f->shared->lf, map_type, f, end, extra_requested)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") else if(ret_value == FALSE) { H5F_blk_aggr_t *aggr; /* Aggregator to use */ /* Check for test block able to extend aggregation block */ - aggr = (alloc_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr); - if((ret_value = H5MF_aggr_try_extend(f, aggr, alloc_type, end, extra_requested)) < 0) + aggr = (map_type == H5FD_MEM_DRAW) ? &(f->shared->sdata_aggr) : &(f->shared->meta_aggr); + if((ret_value = H5MF_aggr_try_extend(f, aggr, map_type, end, extra_requested)) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending aggregation block") else if(ret_value == FALSE) { H5FD_mem_t fs_type; /* Free space type (mapped from allocation type) */ diff --git a/src/H5MFaggr.c b/src/H5MFaggr.c index b3a06ff..6f68fd7 100644 --- a/src/H5MFaggr.c +++ b/src/H5MFaggr.c @@ -46,6 +46,7 @@ /******************/ /* Local Typedefs */ /******************/ +#define EXTEND_THRESHOLD .10 /********************/ @@ -108,14 +109,14 @@ HDfprintf(stderr, "%s: alloc_type = %u, size = %Hu\n", FUNC, (unsigned)alloc_typ HDassert(size > 0); /* Couldn't find anything from the free space manager, go allocate some */ - if(alloc_type != H5FD_MEM_DRAW) { + if(alloc_type != H5FD_MEM_DRAW && alloc_type != H5FD_MEM_GHEAP) { /* Handle metadata differently from "raw" data */ if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->meta_aggr), &(f->shared->sdata_aggr), alloc_type, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate metadata") } /* end if */ else { - /* Allocate "raw" data */ - if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), alloc_type, size))) + /* Allocate "raw" data: H5FD_MEM_DRAW and H5FD_MEM_GHEAP */ + if(HADDR_UNDEF == (ret_value = H5MF_aggr_alloc(f, dxpl_id, &(f->shared->sdata_aggr), &(f->shared->meta_aggr), H5FD_MEM_DRAW, size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate raw data") } /* end else */ @@ -242,7 +243,7 @@ HDfprintf(stderr, "%s: aggr = {%a, %Hu, %Hu}\n", FUNC, aggr->addr, aggr->tot_siz } /* end if */ /* Allocate space from the VFD (i.e. at the end of the file) */ - if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, type, f, size, &eoa_frag_addr, &eoa_frag_size))) + if(HADDR_UNDEF == (ret_value = H5FD_alloc(f->shared->lf, dxpl_id, alloc_type, f, size, &eoa_frag_addr, &eoa_frag_size))) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, HADDR_UNDEF, "can't allocate aggregation block") } /* end else */ } /* end if */ @@ -307,12 +308,12 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* Freeing any possible fragment due to file allocation */ if(eoa_frag_size) - if(H5MF_xfree(f, type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, dxpl_id, eoa_frag_addr, eoa_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free eoa fragment") /* Freeing any possible fragment due to alignment in the block after extension */ if(extended && aggr_frag_size) - if(H5MF_xfree(f, type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end if */ else { @@ -323,7 +324,7 @@ HDfprintf(stderr, "%s: Allocating block\n", FUNC); /* free any possible fragment */ if(aggr_frag_size) - if(H5MF_xfree(f, type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) + if(H5MF_xfree(f, alloc_type, dxpl_id, aggr_frag_addr, aggr_frag_size) < 0) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, HADDR_UNDEF, "can't free aggregation fragment") } /* end else */ } /* end if */ @@ -364,6 +365,16 @@ HDfprintf(stderr, "%s: ret_value = %a\n", FUNC, ret_value); * Purpose: Check if a block is inside an aggregator block and extend it * if possible. * + * Note: + * When the block to be extended adjoins the aggregator-- + * 1) When the aggregator is at end of file: + * A) If the request is below the threshold, extend the block into the aggregator + * B) If the request is above the threshold, + * a) extend the aggregator by aggr->alloc_size or the extended amount + * b) extend the block into the aggregator + * 2) When the aggregator is not at end of file: + * Extended the block into the aggregator if it has enough space to satisfy the request + * * Return: Success: TRUE(1) - Block was extended * FALSE(0) - Block could not be extended * Failure: FAIL @@ -388,26 +399,56 @@ H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, /* Check if this aggregator is active */ if(f->shared->feature_flags & aggr->feature_flag) { - /* If the block being tested adjoins the beginning of the aggregator + /* + * If the block being tested adjoins the beginning of the aggregator * block, check if the aggregator can accomodate the extension. */ if(H5F_addr_eq(blk_end, aggr->addr)) { - /* If the aggregator block is at the end of the file, extend the - * file and "bubble" the aggregator up - */ - if((ret_value = H5FD_try_extend(f->shared->lf, type, f, (aggr->addr + aggr->size), extra_requested)) < 0) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") - else if(ret_value == TRUE) { - /* Shift the aggregator block by the extra requested */ - aggr->addr += extra_requested; - - /* Add extra requested to the aggregator block's total amount allocated */ - aggr->tot_size += extra_requested; - } /* end if */ - else { - /* Check if the aggregator block has enough internal space to satisfy - * extending the block. - */ + haddr_t eoa; /* EOA for the file */ + + /* Get the EOA for the file */ + if(HADDR_UNDEF == (eoa = H5F_get_eoa(f, type))) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGET, FAIL, "Unable to get eoa") + + /* If the aggregator is at the end of file: */ + if(H5F_addr_eq(eoa, aggr->addr + aggr->size)) { + /* If extra_requested is below percentage threshold, extend block into the aggregator. */ + if(extra_requested <= (EXTEND_THRESHOLD * aggr->size)) { + aggr->size -= extra_requested; + aggr->addr += extra_requested; + + /* Indicate success */ + HGOTO_DONE(TRUE); + } + /* + * If extra_requested is above percentage threshold: + * 1) "bubble" up the aggregator by aggr->alloc_size or extra_requested + * 2) extend the block into the aggregator + */ + else { + hsize_t extra = (extra_requested < aggr->alloc_size) ? aggr->alloc_size : extra_requested; + + if((ret_value = H5FD_try_extend(f->shared->lf, type, f, (aggr->addr + aggr->size), extra)) < 0) + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTEXTEND, FAIL, "error extending file") + else if(ret_value == TRUE) { + /* Shift the aggregator block by the extra requested */ + /* (allocates the space for the extra_requested) */ + aggr->addr += extra_requested; + + /* Add extra to the aggregator's total allocated amount */ + aggr->tot_size += extra; + + /* Account for any space added to the aggregator */ + /* (either 0 (if extra_requested > aggr->alloc_size) or + * (aggr->alloc_size - extra_requested) -QAK + */ + aggr->size += extra; + aggr->size -= extra_requested; + } /* end if */ + } /* end if */ + } /* end if */ + else { /* The aggreator is not at end of file */ + /* Check if aggregator has enough internal space to satisfy the extension. */ if(aggr->size >= extra_requested) { /* Extend block into aggregator */ aggr->size -= extra_requested; @@ -416,8 +457,8 @@ H5MF_aggr_try_extend(H5F_t *f, H5F_blk_aggr_t *aggr, H5FD_mem_t type, /* Indicate success */ HGOTO_DONE(TRUE); } /* end if */ - } /* end else */ - } /* end if */ + } /* end else */ + } /* end if */ } /* end if */ done: diff --git a/test/mf.c b/test/mf.c index 3b1a8d8..3742051 100644 --- a/test/mf.c +++ b/test/mf.c @@ -3184,8 +3184,13 @@ error: * To verify that a block can be extended from the aggregator * * Test 1: Allocate block A from meta_aggr which is at end of file - * Try to extend a block which adjoins the aggregator - * H5MF_try_extend() succeeds: meta_aggr is extended by extended-request and meta_aggr's info is updated + * Try to extend the block which adjoins the aggregator that is at end of file + * a. block size < (% * aggr->alloc_size) + * The block is allocated from the aggregator + * b. block size > (% * aggr->alloc_size) but block size < aggr->alloc_size + * The block is extended by aggr->alloc_size and the block is allocated from the aggregator + * c. block size > (% * aggr->alloc_size) but block size > aggr->alloc_size + * The block is extended by extended-request and the block is allocated from the aggregator * * Test 2: Allocate block A from meta_aggr * Allocate block B from sdata_aggr so that meta_aggr is not at end of file @@ -3252,7 +3257,7 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) new_addr = addr - 10; - /* Try to extend the block */ + /* Try to extend the block by an amount < (% * aggr->alloc_size) */ extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE50)); /* should succeed */ @@ -3263,15 +3268,42 @@ test_mf_aggr_extend(const char *env_h5_drvr, hid_t fapl) if (new_ma_addr != (addr+TEST_BLOCK_SIZE50)) TEST_ERROR - if (new_ma_size != f->shared->meta_aggr.alloc_size) TEST_ERROR + if (new_ma_size != (f->shared->meta_aggr.alloc_size - TEST_BLOCK_SIZE50)) TEST_ERROR - /* Restore info for meta_aggr */ - f->shared->meta_aggr.addr = ma_addr; - f->shared->meta_aggr.size = ma_size; + /* Free the allocated blocks */ + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE50); + + /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount < aggr->alloc_size */ + extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE700)); + + /* should succeed */ + if(!extended) + TEST_ERROR + + H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + + if (new_ma_addr != (addr + TEST_BLOCK_SIZE700)) + TEST_ERROR + if (new_ma_size != (f->shared->meta_aggr.alloc_size * 2 - TEST_BLOCK_SIZE700)) TEST_ERROR /* Free the allocated blocks */ - H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE30); - H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, (ma_addr+ma_size), (hsize_t)TEST_BLOCK_SIZE50); + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE700); + + /* Try to extend the block by an amount > (% * aggr->alloc_size) but amount > aggr->alloc_size */ + extended = H5MF_try_extend(f, H5P_DATASET_XFER_DEFAULT, type, (haddr_t)new_addr, (hsize_t)10, (hsize_t)(TEST_BLOCK_SIZE2058)); + + /* should succeed */ + if(!extended) + TEST_ERROR + + H5MF_aggr_query(f, &(f->shared->meta_aggr), &new_ma_addr, &new_ma_size); + + if (new_ma_addr != (addr + TEST_BLOCK_SIZE2058)) + TEST_ERROR + if (new_ma_size != f->shared->meta_aggr.size) TEST_ERROR + + /* Free the allocated blocks */ + H5MF_xfree(f, type, H5P_DATASET_XFER_DEFAULT, addr, (hsize_t)TEST_BLOCK_SIZE2058); if(H5Fclose(file) < 0) FAIL_STACK_ERROR diff --git a/tools/h5copy/testfiles/h5copy_ref.out.ls b/tools/h5copy/testfiles/h5copy_ref.out.ls index 0769dc8..d685af2 100644 --- a/tools/h5copy/testfiles/h5copy_ref.out.ls +++ b/tools/h5copy/testfiles/h5copy_ref.out.ls @@ -21,7 +21,7 @@ Opened "./testfiles/h5copy_ref.out.h5" with sec2 driver. Storage:
Type: object reference /COPY/Dset_REGREF Dataset {2/2} - Location: 1:9400 + Location: 1:5304 Links: 1 Storage:
Type: dataset region reference diff --git a/tools/h5copy/testfiles/h5copytst.out.ls b/tools/h5copy/testfiles/h5copytst.out.ls index 62c860b..4044aaf 100644 --- a/tools/h5copy/testfiles/h5copytst.out.ls +++ b/tools/h5copy/testfiles/h5copytst.out.ls @@ -3,57 +3,57 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Location: 1:96 Links: 1 /A Group - Location: 1:88336 + Location: 1:84304 Links: 1 /A/B1 Group - Location: 1:89040 + Location: 1:85008 Links: 1 /A/B1/simple Dataset {6/6} - Location: 1:88208 + Location: 1:84176 Links: 1 Storage:
Type: 32-bit little-endian integer /A/B2 Group - Location: 1:92576 + Location: 1:88544 Links: 1 /A/B2/simple2 Dataset {6/6} - Location: 1:92448 + Location: 1:88416 Links: 1 Storage:
Type: 32-bit little-endian integer /C Group - Location: 1:95784 + Location: 1:91752 Links: 1 /C/D Group - Location: 1:96488 + Location: 1:92456 Links: 1 /C/D/simple Dataset {6/6} - Location: 1:95656 + Location: 1:91624 Links: 1 Storage:
Type: 32-bit little-endian integer /E Group - Location: 1:110400 + Location: 1:106368 Links: 1 /E/F Group - Location: 1:111104 + Location: 1:107072 Links: 1 /E/F/grp_dsets Group - Location: 1:98600 + Location: 1:94568 Links: 1 /E/F/grp_dsets/chunk Dataset {6/6} - Location: 1:102784 + Location: 1:98752 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/compact Dataset {6/6} - Location: 1:103240 + Location: 1:99208 Links: 1 Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/compound Dataset {2/2} - Location: 1:103376 + Location: 1:99344 Links: 1 Storage:
Type: struct { @@ -61,60 +61,60 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /E/F/grp_dsets/compressed Dataset {6/6} - Location: 1:105688 + Location: 1:101656 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /E/F/grp_dsets/named_vl Dataset {2/2} - Location: 1:109952 + Location: 1:105920 Links: 1 Storage:
- Type: shared-1:110080 variable length of + Type: shared-1:106048 variable length of 32-bit little-endian integer /E/F/grp_dsets/nested_vl Dataset {2/2} - Location: 1:110128 + Location: 1:106096 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /E/F/grp_dsets/simple Dataset {6/6} - Location: 1:110272 + Location: 1:106240 Links: 1 Storage:
Type: 32-bit little-endian integer /E/F/grp_dsets/vl Type - Location: 1:110080 + Location: 1:106048 Links: 2 - Type: shared-1:110080 variable length of + Type: shared-1:106048 variable length of 32-bit little-endian integer /G Group - Location: 1:126048 + Location: 1:122016 Links: 1 /G/H Group - Location: 1:126752 + Location: 1:122720 Links: 1 /G/H/grp_nested Group - Location: 1:113128 + Location: 1:109096 Links: 1 /G/H/grp_nested/grp_dsets Group - Location: 1:113920 + Location: 1:109888 Links: 1 /G/H/grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:118104 + Location: 1:114072 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:118560 + Location: 1:114528 Links: 1 Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:118696 + Location: 1:114664 Links: 1 Storage:
Type: struct { @@ -122,34 +122,34 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /G/H/grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:121008 + Location: 1:116976 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:125272 + Location: 1:121240 Links: 1 Storage:
- Type: shared-1:125400 variable length of + Type: shared-1:121368 variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:125448 + Location: 1:121416 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /G/H/grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:125592 + Location: 1:121560 Links: 1 Storage:
Type: 32-bit little-endian integer /G/H/grp_nested/grp_dsets/vl Type - Location: 1:125400 + Location: 1:121368 Links: 2 - Type: shared-1:125400 variable length of + Type: shared-1:121368 variable length of 32-bit little-endian integer /chunk Dataset {6/6} Location: 1:6312 @@ -178,21 +178,21 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets Group - Location: 1:32160 + Location: 1:28128 Links: 1 /grp_dsets/chunk Dataset {6/6} - Location: 1:36344 + Location: 1:32312 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_dsets/compact Dataset {6/6} - Location: 1:36800 + Location: 1:32768 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/compound Dataset {2/2} - Location: 1:36936 + Location: 1:32904 Links: 1 Storage:
Type: struct { @@ -200,62 +200,62 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_dsets/compressed Dataset {6/6} - Location: 1:39248 + Location: 1:35216 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_dsets/named_vl Dataset {2/2} - Location: 1:43512 + Location: 1:39480 Links: 1 Storage:
- Type: shared-1:43640 variable length of + Type: shared-1:39608 variable length of 32-bit little-endian integer /grp_dsets/nested_vl Dataset {2/2} - Location: 1:43688 + Location: 1:39656 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_dsets/simple Dataset {6/6} - Location: 1:43832 + Location: 1:39800 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/simple_group Dataset {6/6} - Location: 1:59944 + Location: 1:55912 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_dsets/vl Type - Location: 1:43640 + Location: 1:39608 Links: 2 - Type: shared-1:43640 variable length of + Type: shared-1:39608 variable length of 32-bit little-endian integer /grp_empty Group - Location: 1:31368 + Location: 1:27336 Links: 1 /grp_nested Group - Location: 1:44624 + Location: 1:40592 Links: 1 /grp_nested/grp_dsets Group - Location: 1:45416 + Location: 1:41384 Links: 1 /grp_nested/grp_dsets/chunk Dataset {6/6} - Location: 1:49600 + Location: 1:45568 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/compact Dataset {6/6} - Location: 1:50056 + Location: 1:46024 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/compound Dataset {2/2} - Location: 1:50192 + Location: 1:46160 Links: 1 Storage:
Type: struct { @@ -263,51 +263,51 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_nested/grp_dsets/compressed Dataset {6/6} - Location: 1:52504 + Location: 1:48472 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_nested/grp_dsets/named_vl Dataset {2/2} - Location: 1:56768 + Location: 1:52736 Links: 1 Storage:
- Type: shared-1:56896 variable length of + Type: shared-1:52864 variable length of 32-bit little-endian integer /grp_nested/grp_dsets/nested_vl Dataset {2/2} - Location: 1:56944 + Location: 1:52912 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_nested/grp_dsets/simple Dataset {6/6} - Location: 1:57088 + Location: 1:53056 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_nested/grp_dsets/vl Type - Location: 1:56896 + Location: 1:52864 Links: 2 - Type: shared-1:56896 variable length of + Type: shared-1:52864 variable length of 32-bit little-endian integer /grp_rename Group - Location: 1:61152 + Location: 1:57120 Links: 1 /grp_rename/chunk Dataset {6/6} - Location: 1:65336 + Location: 1:61304 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_rename/compact Dataset {6/6} - Location: 1:65792 + Location: 1:61760 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/compound Dataset {2/2} - Location: 1:65928 + Location: 1:61896 Links: 1 Storage:
Type: struct { @@ -315,28 +315,28 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/compressed Dataset {6/6} - Location: 1:68240 + Location: 1:64208 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets Group - Location: 1:74032 + Location: 1:70000 Links: 1 /grp_rename/grp_dsets/chunk Dataset {6/6} - Location: 1:78216 + Location: 1:74184 Links: 1 Chunks: {2} 8 bytes Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/compact Dataset {6/6} - Location: 1:78672 + Location: 1:74640 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/compound Dataset {2/2} - Location: 1:78808 + Location: 1:74776 Links: 1 Storage:
Type: struct { @@ -344,73 +344,73 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. "str2" +20 20-byte null-terminated ASCII string } 40 bytes /grp_rename/grp_dsets/compressed Dataset {6/6} - Location: 1:81120 + Location: 1:77088 Links: 1 Chunks: {2} 8 bytes Storage:
Filter-0: deflate-1 OPT {1} Type: 32-bit little-endian integer /grp_rename/grp_dsets/named_vl Dataset {2/2} - Location: 1:85384 + Location: 1:81352 Links: 1 Storage:
- Type: shared-1:85512 variable length of + Type: shared-1:81480 variable length of 32-bit little-endian integer /grp_rename/grp_dsets/nested_vl Dataset {2/2} - Location: 1:85560 + Location: 1:81528 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_rename/grp_dsets/simple Dataset {6/6} - Location: 1:85704 + Location: 1:81672 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/grp_dsets/vl Type - Location: 1:85512 + Location: 1:81480 Links: 2 - Type: shared-1:85512 variable length of + Type: shared-1:81480 variable length of 32-bit little-endian integer /grp_rename/named_vl Dataset {2/2} - Location: 1:72504 + Location: 1:68472 Links: 1 Storage:
- Type: shared-1:72632 variable length of + Type: shared-1:68600 variable length of 32-bit little-endian integer /grp_rename/nested_vl Dataset {2/2} - Location: 1:72680 + Location: 1:68648 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /grp_rename/simple Dataset {6/6} - Location: 1:72824 + Location: 1:68792 Links: 1 Storage:
Type: 32-bit little-endian integer /grp_rename/vl Type - Location: 1:72632 + Location: 1:68600 Links: 2 - Type: shared-1:72632 variable length of + Type: shared-1:68600 variable length of 32-bit little-endian integer /named_vl Dataset {2/2} - Location: 1:19296 + Location: 1:17280 Links: 1 Storage:
- Type: shared-1:19424 variable length of + Type: shared-1:17408 variable length of 32-bit little-endian integer /nested_vl Dataset {2/2} - Location: 1:25792 + Location: 1:21760 Links: 1 Storage:
Type: variable length of variable length of 32-bit little-endian integer /rename Dataset {2/2} - Location: 1:30160 + Location: 1:26128 Links: 1 Storage:
Type: struct { @@ -423,7 +423,7 @@ Opened "./testfiles/h5copytst.out.h5" with sec2 driver. Storage:
Type: 32-bit little-endian integer /simple_top Dataset {6/6} - Location: 1:27984 + Location: 1:23952 Links: 1 Storage:
Type: 32-bit little-endian integer diff --git a/tools/h5stat/h5stat.c b/tools/h5stat/h5stat.c index 99ea688..a68760d 100644 --- a/tools/h5stat/h5stat.c +++ b/tools/h5stat/h5stat.c @@ -937,36 +937,9 @@ error: /*------------------------------------------------------------------------- - * Function: init_iter + * Function: iter_free * - * Purpose: Initialize iter structure - * - * Return: Success: 0 - * - * Failure: Never fails - * - * Programmer: Elena Pourmal - * Saturday, August 12, 2006 - * - *------------------------------------------------------------------------- - */ -static herr_t -iter_init(iter_t *iter, hid_t fid) -{ - /* Clear everything to zeros */ - HDmemset(iter, 0, sizeof(*iter)); - - /* Set the file ID for later use in callbacks */ - iter->fid = fid; - - return 0; -} /* iter_init() */ - - -/*------------------------------------------------------------------------- - * Function: free_iter - * - * Purpose: Freee iter structure + * Purpose: Free iter structure * * Return: Success: 0 * @@ -1610,7 +1583,7 @@ main(int argc, const char *argv[]) { iter_t iter; const char *fname = NULL; - hid_t fid; + hid_t fid = -1; hid_t fcpl; struct handler_t *hand = NULL; H5F_info2_t finfo; @@ -1633,6 +1606,8 @@ main(int argc, const char *argv[]) printf("Filename: %s\n", fname); + HDmemset(&iter, 0, sizeof(iter)); + fid = H5Fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT); if(fid < 0) { error_msg("unable to open file \"%s\"\n", fname); @@ -1641,7 +1616,7 @@ main(int argc, const char *argv[]) } /* end if */ /* Initialize iter structure */ - iter_init(&iter, fid); + iter.fid = fid; if(H5Fget_filesize(fid, &iter.filesize) < 0) warn_msg("Unable to retrieve file size\n"); @@ -1708,7 +1683,7 @@ done: /* Free iter structure */ iter_free(&iter); - if(H5Fclose(fid) < 0) { + if(fid >= 0 && H5Fclose(fid) < 0) { error_msg("unable to close file \"%s\"\n", fname); h5tools_setstatus(EXIT_FAILURE); } diff --git a/tools/h5stat/testfiles/h5stat_notexist.ddl b/tools/h5stat/testfiles/h5stat_notexist.ddl new file mode 100644 index 0000000..ac0fce4 --- /dev/null +++ b/tools/h5stat/testfiles/h5stat_notexist.ddl @@ -0,0 +1,5 @@ +############################# +Expected output for 'h5stat notexist.h5' +############################# +Filename: notexist.h5 +h5stat error: unable to open file "notexist.h5" diff --git a/tools/h5stat/testh5stat.sh.in b/tools/h5stat/testh5stat.sh.in index c5cb3e8..c594a97 100644 --- a/tools/h5stat/testh5stat.sh.in +++ b/tools/h5stat/testh5stat.sh.in @@ -77,6 +77,7 @@ $SRC_H5STAT_TESTFILES/h5stat_newgrat.h5 LIST_OTHER_TEST_FILES=" $SRC_H5STAT_TESTFILES/h5stat_help1.ddl $SRC_H5STAT_TESTFILES/h5stat_help2.ddl +$SRC_H5STAT_TESTFILES/h5stat_notexist.ddl $SRC_H5STAT_TESTFILES/h5stat_filters.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-file.ddl $SRC_H5STAT_TESTFILES/h5stat_filters-F.ddl @@ -189,6 +190,8 @@ COPY_TESTFILES_TO_TESTDIR # Test for help flag TOOLTEST h5stat_help1.ddl -h TOOLTEST h5stat_help2.ddl --help +# Test when h5stat a file that does not exist +TOOLTEST h5stat_notexist.ddl notexist.h5 # Test file with groups, compressed datasets, user-applied fileters, etc. # h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 -- cgit v0.12 From 0820bef83e258c42294583e140e59f0637a77694 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 7 Jun 2012 16:06:57 -0500 Subject: [svn-r22445] Add new test to CMake file Tested: local linux --- tools/h5stat/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index a9c5d11..091da9a 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -41,6 +41,7 @@ IF (BUILD_TESTING) SET (HDF5_REFERENCE_FILES h5stat_help1.ddl h5stat_help2.ddl + h5stat_notexist.ddl h5stat_filters.ddl h5stat_filters-file.ddl h5stat_filters-F.ddl @@ -133,6 +134,8 @@ IF (BUILD_TESTING) h5stat_help1.out.err h5stat_help2.out h5stat_help2.out.err + h5stat_notexist.out + h5stat_notexist.out.err h5stat_filters.out h5stat_filters.out.err h5stat_filters-file.out @@ -168,6 +171,9 @@ IF (BUILD_TESTING) ADD_H5_TEST (h5stat_help1 0 -h) ADD_H5_TEST (h5stat_help2 0 --help) +# Test when h5stat a file that does not exist + ADD_H5_TEST (h5stat_notexist 1 notexist.h5) + # Test file with groups, compressed datasets, user-applied fileters, etc. # h5stat_filters.h5 is a copy of ../../testfiles/tfilters.h5 as of release 1.8.0-alpha4 ADD_H5_TEST (h5stat_filters 0 h5stat_filters.h5) -- cgit v0.12 From dde94c349e8653028631f92ed06c40772c7876cc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 8 Jun 2012 11:00:58 -0500 Subject: [svn-r22447] DAILYTEST-13: Remove check for vsnprintf works in config. Correct HAVE_WINSOCK name. Tested: windows --- config/cmake/ConfigureChecks.cmake | 36 +++++++++++------------------------- src/CMakeLists.txt | 11 ----------- src/H5config.h.in | 2 +- 3 files changed, 12 insertions(+), 37 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 4a2daf2..0948675 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -153,23 +153,16 @@ IF (WINDOWS) # that is, "drive-letter:\" (e.g. "C:") or "drive-letter:/" (e.g. "C:/"). # (This flag should be _unset_ for all machines, except for Windows) SET (H5_HAVE_WINDOW_PATH 1) -# SET (LINK_LIBS ${LINK_LIBS} "kernel32") ENDIF (WINDOWS) IF (WINDOWS) - SET (H5_HAVE_IO_H 1) - SET (H5_HAVE_SETJMP_H 1) SET (H5_HAVE_STDDEF_H 1) SET (H5_HAVE_SYS_STAT_H 1) - SET (H5_HAVE_SYS_TIMEB_H 1) SET (H5_HAVE_SYS_TYPES_H 1) - SET (H5_HAVE_WINSOCK_H 1) SET (H5_HAVE_LIBM 1) SET (H5_HAVE_STRDUP 1) SET (H5_HAVE_SYSTEM 1) - SET (H5_HAVE_DIFFTIME 1) SET (H5_HAVE_LONGJMP 1) - SET (H5_STDC_HEADERS 1) IF (NOT MINGW) SET (H5_HAVE_GETHOSTNAME 1) ENDIF (NOT MINGW) @@ -189,9 +182,7 @@ ENDIF (WINDOWS) # something not quite correct with the actual test implementation. This affects # the 'dt_arith' test and most likely lots of other code # ---------------------------------------------------------------------------- -IF (WINDOWS) - SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") -ENDIF (WINDOWS) +SET (H5_FP_TO_ULLONG_RIGHT_MAXIMUM "" CACHE INTERNAL "") # ---------------------------------------------------------------------- # END of WINDOWS Hard code Values @@ -283,9 +274,7 @@ ENDMACRO (HDF5_FUNCTION_TEST) #----------------------------------------------------------------------------- # Check for these functions before the time headers are checked #----------------------------------------------------------------------------- -IF (NOT WINDOWS) - HDF5_FUNCTION_TEST (STDC_HEADERS) -ENDIF (NOT WINDOWS) +HDF5_FUNCTION_TEST (STDC_HEADERS) CHECK_FUNCTION_EXISTS (difftime H5_HAVE_DIFFTIME) #CHECK_FUNCTION_EXISTS (gettimeofday H5_HAVE_GETTIMEOFDAY) @@ -590,16 +579,13 @@ IF (NOT WINDOWS) # Does the struct stat have the st_blocks field? This field is not Posix. # HDF5_FUNCTION_TEST (HAVE_STAT_ST_BLOCKS) - -ENDIF (NOT WINDOWS) -# ---------------------------------------------------------------------- -# How do we figure out the width of a tty in characters? -# -CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) -HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) -HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) -IF (NOT WINDOWS) + # ---------------------------------------------------------------------- + # How do we figure out the width of a tty in characters? + # + CHECK_FUNCTION_EXISTS (ioctl H5_HAVE_IOCTL) + HDF5_FUNCTION_TEST (HAVE_STRUCT_VIDEOCONFIG) + HDF5_FUNCTION_TEST (HAVE_STRUCT_TEXT_INFO) CHECK_FUNCTION_EXISTS (_getvideoconfig H5_HAVE__GETVIDEOCONFIG) CHECK_FUNCTION_EXISTS (gettextinfo H5_HAVE_GETTEXTINFO) CHECK_FUNCTION_EXISTS (_scrsize H5_HAVE__SCRSIZE) @@ -645,9 +631,9 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -IF (H5_HAVE_VSNPRINTF) - HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) -ENDIF (H5_HAVE_VSNPRINTF) +#IF (H5_HAVE_VSNPRINTF) +# HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) +#ENDIF (H5_HAVE_VSNPRINTF) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de9c50c..c67431b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,7 +21,6 @@ SET (H5_HDRS ) IDE_GENERATED_PROPERTIES ("H5" "${H5_HDRS}" "${H5_SRCS}" ) - SET (H5A_SRCS ${HDF5_SRC_DIR}/H5A.c ${HDF5_SRC_DIR}/H5Abtree2.c @@ -36,7 +35,6 @@ SET (H5A_HDRS ) IDE_GENERATED_PROPERTIES ("H5A" "${H5A_HDRS}" "${H5A_SRCS}" ) - SET (H5AC_SRCS ${HDF5_SRC_DIR}/H5AC.c ) @@ -46,7 +44,6 @@ SET (H5AC_HDRS ) IDE_GENERATED_PROPERTIES ("H5AC" "${H5AC_HDRS}" "${H5AC_SRCS}" ) - SET (H5B_SRCS ${HDF5_SRC_DIR}/H5B.c ${HDF5_SRC_DIR}/H5Bcache.c @@ -118,7 +115,6 @@ SET (H5D_HDRS ) IDE_GENERATED_PROPERTIES ("H5D" "${H5D_HDRS}" "${H5D_SRCS}" ) - SET (H5E_SRCS ${HDF5_SRC_DIR}/H5E.c ${HDF5_SRC_DIR}/H5Edeprec.c @@ -258,7 +254,6 @@ SET (H5FS_HDRS ) IDE_GENERATED_PROPERTIES ("H5FS" "${H5FS_HDRS}" "${H5FS_SRCS}" ) - SET (H5G_SRCS ${HDF5_SRC_DIR}/H5G.c ${HDF5_SRC_DIR}/H5Gbtree2.c @@ -285,7 +280,6 @@ SET (H5G_HDRS ) IDE_GENERATED_PROPERTIES ("H5G" "${H5G_HDRS}" "${H5G_SRCS}" ) - SET (H5HF_SRCS ${HDF5_SRC_DIR}/H5HF.c ${HDF5_SRC_DIR}/H5HFbtree2.c @@ -310,7 +304,6 @@ SET (H5HF_HDRS ) IDE_GENERATED_PROPERTIES ("H5HF" "${H5HF_HDRS}" "${H5HF_SRCS}" ) - SET (H5HG_SRCS ${HDF5_SRC_DIR}/H5HG.c ${HDF5_SRC_DIR}/H5HGcache.c @@ -323,7 +316,6 @@ SET (H5HG_HDRS ) IDE_GENERATED_PROPERTIES ("H5HG" "${H5HG_HDRS}" "${H5HG_SRCS}" ) - SET (H5HL_SRCS ${HDF5_SRC_DIR}/H5HL.c ${HDF5_SRC_DIR}/H5HLcache.c @@ -396,7 +388,6 @@ SET (H5MP_HDRS ) IDE_GENERATED_PROPERTIES ("H5MP" "${H5MP_HDRS}" "${H5MP_SRCS}" ) - SET (H5O_SRCS ${HDF5_SRC_DIR}/H5O.c ${HDF5_SRC_DIR}/H5Oainfo.c @@ -439,7 +430,6 @@ SET (H5O_HDRS ) IDE_GENERATED_PROPERTIES ("H5O" "${H5O_HDRS}" "${H5O_SRCS}" ) - SET (H5P_SRCS ${HDF5_SRC_DIR}/H5P.c ${HDF5_SRC_DIR}/H5Pacpl.c @@ -616,7 +606,6 @@ SET (H5Z_HDRS ) IDE_GENERATED_PROPERTIES ("H5Z" "${H5Z_HDRS}" "${H5Z_SRCS}" ) - SET (common_SRCS ${H5_SRCS} ${H5A_SRCS} diff --git a/src/H5config.h.in b/src/H5config.h.in index 6176b33..a8668b8 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -406,7 +406,7 @@ #undef HAVE_WINDOW_PATH /* Define to 1 if you have the header file. */ -#undef HAVE_WINSOCK2_H +#undef HAVE_WINSOCK_H /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H -- cgit v0.12 From d1b7eede73dd9968042b3e8e1bbabe8949d670ed Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 10 Jun 2012 08:53:06 -0500 Subject: [svn-r22448] Snapshot version 1.9 release 121 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- release_docs/RELEASE.txt | 2 +- src/H5config.h.in | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 15 files changed, 31 insertions(+), 31 deletions(-) diff --git a/README.txt b/README.txt index 3a0ddf0..7b77f8e 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.121 currently under development +HDF5 version 1.9.122 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index 511c6aa..c265924 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 8f6408a..48f0d67 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index 55ecfba..515a9e4 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22427 2012-06-03 14:29:20Z hdftest . +# From configure.in Id: configure.in 22430 2012-06-04 17:05:02Z byrn . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.121. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.122. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.121' -PACKAGE_STRING='HDF5 1.9.121' +PACKAGE_VERSION='1.9.122' +PACKAGE_STRING='HDF5 1.9.122' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.121 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.122 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.121:";; + short | recursive ) echo "Configuration of HDF5 1.9.122:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.121 +HDF5 configure 1.9.122 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.121, which was +It was created by HDF5 $as_me 1.9.122, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.121' + VERSION='1.9.122' cat >>confdefs.h <<_ACEOF @@ -30605,7 +30605,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.121, which was +This file was extended by HDF5 $as_me 1.9.122, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30671,7 +30671,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.121 +HDF5 config.status 1.9.122 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33466,7 +33466,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.121 +HDF5 config.lt 1.9.122 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 3283cc8..3dc354b 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.121], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.122], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index b7d7a6e..46ffc46 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index 0bc6d46..cae86d3 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index caff13a..4644586 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index b5e8a88..bc88d4d 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 # This library is our main target. diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 2645737..4558ade 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.121 currently under development +HDF5 version 1.9.122 currently under development ================================================================================ diff --git a/src/H5config.h.in b/src/H5config.h.in index a8668b8..6176b33 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -406,7 +406,7 @@ #undef HAVE_WINDOW_PATH /* Define to 1 if you have the header file. */ -#undef HAVE_WINSOCK_H +#undef HAVE_WINSOCK2_H /* Define to 1 if you have the header file. */ #undef HAVE_ZLIB_H diff --git a/src/H5public.h b/src/H5public.h index 5bb1b1e..7d834de 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 121 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 122 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.121" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.122" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index 76ff24a..c06f8d8 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 111 +LT_VERS_REVISION = 112 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index b4a7496..889d7ba 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.121" +#define H5_PACKAGE_STRING "HDF5 1.9.122" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.121" +#define H5_PACKAGE_VERSION "1.9.122" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.121" +#define H5_VERSION "1.9.122" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 66bb0eb..8e1a76a 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.121" +#define H5_PACKAGE_STRING "HDF5 1.9.122" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.121" +#define H5_PACKAGE_VERSION "1.9.122" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.121" +#define H5_VERSION "1.9.122" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12 From 75f31948821d7b134f20948f1d3c18547c4c654f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Jun 2012 10:49:25 -0500 Subject: [svn-r22450] Update winsock define to match autotools configure check --- config/cmake/ConfigureChecks.cmake | 2 +- config/cmake/H5pubconf.h.in | 2 +- perform/sio_timer.h | 4 ++-- src/H5private.h | 2 +- src/H5system.c | 6 +++--- vms/src/h5pubconf.h | 2 +- windows/src/H5pubconf.h | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 0948675..01a4d0e 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -376,7 +376,7 @@ CHECK_INCLUDE_FILE_CONCAT ("mach/mach_time.h" H5_HAVE_MACH_MACH_TIME_H) # Windows CHECK_INCLUDE_FILE_CONCAT ("io.h" H5_HAVE_IO_H) IF (NOT CYGWIN) - CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK_H) + CHECK_INCLUDE_FILE_CONCAT ("winsock2.h" H5_HAVE_WINSOCK2_H) ENDIF (NOT CYGWIN) CHECK_INCLUDE_FILE_CONCAT ("sys/timeb.h" H5_HAVE_SYS_TIMEB_H) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 80406a3..0c6cc0b 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -461,7 +461,7 @@ #cmakedefine H5_HAVE_WINDOW_PATH @H5_HAVE_WINDOW_PATH@ /* Define to 1 if you have the header file. */ -#cmakedefine H5_HAVE_WINSOCK_H @H5_HAVE_WINSOCK_H@ +#cmakedefine H5_HAVE_WINSOCK2_H @H5_HAVE_WINSOCK2_H@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_ZLIB_H @H5_HAVE_ZLIB_H@ diff --git a/perform/sio_timer.h b/perform/sio_timer.h index 04432af..46702c3 100644 --- a/perform/sio_timer.h +++ b/perform/sio_timer.h @@ -26,9 +26,9 @@ # include #endif -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H # include -#endif /* H5_HAVE_WINSOCK_H */ +#endif /* H5_HAVE_WINSOCK2_H */ /* The different types of timers we can have */ typedef enum timer_type_ { diff --git a/src/H5private.h b/src/H5private.h index 76d8a05..39ccb52 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -155,7 +155,7 @@ #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */ #define NOGDI /* Exclude Graphic Display Interface macros */ -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H #include #endif diff --git a/src/H5system.c b/src/H5system.c index bb1d2f1..c0baee1 100644 --- a/src/H5system.c +++ b/src/H5system.c @@ -639,7 +639,7 @@ Wgettimeofday(struct timeval *tv, struct timezone *tz) return 0; } -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H #pragma comment(lib, "advapi32.lib") #endif @@ -650,12 +650,12 @@ char* Wgetlogin() { -#ifdef H5_HAVE_WINSOCK_H +#ifdef H5_HAVE_WINSOCK2_H long bufferCount = WloginBuffer_count; if (GetUserName(Wlogin_buffer, &bufferCount) == 0) return (Wlogin_buffer); else -#endif /* H5_HAVE_WINSOCK_H */ +#endif /* H5_HAVE_WINSOCK2_H */ return NULL; } diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 889d7ba..48748b5 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -418,7 +418,7 @@ /* #undef H5_HAVE_WINDOW_PATH */ /* Define to 1 if you have the header file. */ -/* #undef H5_HAVE_WINSOCK_H */ +/* #undef H5_HAVE_WINSOCK2_H */ /* Define to 1 if you have the header file. */ #define H5_HAVE_ZLIB_H 1 diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 8e1a76a..99f466d 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -443,7 +443,7 @@ #define H5_HAVE_WINDOW_PATH 1 /* Define to 1 if you have the header file. */ -#define H5_HAVE_WINSOCK_H 1 +#define H5_HAVE_WINSOCK2_H 1 /* Define to 1 if you have the header file. */ #define H5_HAVE_ZLIB_H 1 -- cgit v0.12 From 20d45c853d83eb04fc72e01a3b5461240312095d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Jun 2012 08:50:47 -0500 Subject: [svn-r22453] Add missing property for resultcode of 1 to MEMCHECKER tests --- tools/h5stat/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index 091da9a..fa9f815 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -93,6 +93,9 @@ IF (BUILD_TESTING) # If using memchecker add tests without using scripts IF (HDF5_ENABLE_USING_MEMCHECKER) ADD_TEST (NAME H5STAT-${resultfile} COMMAND $ ${ARGN}) + IF (NOT ${resultcode} STREQUAL "0") + SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") + ENDIF (NOT ${resultcode} STREQUAL "0") IF (NOT "${last_test}" STREQUAL "") SET_TESTS_PROPERTIES (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) ENDIF (NOT "${last_test}" STREQUAL "") -- cgit v0.12 From c02719a4c811a65c7886249f3a421f7271f2c89b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 12 Jun 2012 08:55:01 -0500 Subject: [svn-r22455] Add NOT WINDOWS blocking around VSNPRINTF works check. --- config/cmake/ConfigureChecks.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 01a4d0e..bbd310e 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -631,9 +631,11 @@ CHECK_FUNCTION_EXISTS (vasprintf H5_HAVE_VASPRINTF) CHECK_FUNCTION_EXISTS (waitpid H5_HAVE_WAITPID) CHECK_FUNCTION_EXISTS (vsnprintf H5_HAVE_VSNPRINTF) -#IF (H5_HAVE_VSNPRINTF) -# HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) -#ENDIF (H5_HAVE_VSNPRINTF) +IF (NOT WINDOWS) + IF (H5_HAVE_VSNPRINTF) + HDF5_FUNCTION_TEST (VSNPRINTF_WORKS) + ENDIF (H5_HAVE_VSNPRINTF) +ENDIF (NOT WINDOWS) #----------------------------------------------------------------------------- # sigsetjmp is special; may actually be a macro -- cgit v0.12 From 0a6b3c2d4b5b0ac55c770267ec8cb44d827791f5 Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 12 Jun 2012 15:55:52 -0500 Subject: [svn-r22458] I added an item in the known problem section for the data conversion problem on Mac Lion. --- release_docs/RELEASE.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 4558ade..93d2dd1 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1129,6 +1129,13 @@ SuSe Linux 2.6.5 Known Problems ============== +* The data conversion test dt_arith.c has failures (segmentation fault) from + "long double" to other datatypes during hard conversion when the library + is built with the default GCC 4.2.1 on Mac Lion system. It only happens + with optimization (-O3, -O2, and -O1). Some newer versions of GCC do not + have this problem. Users should disable optimization or try newer version + of GCC. (Issue 8017. SLU - 2012/6/12) + * The data conversion test dt_arith.c fails in "long double" to integer conversion on Ubuntu 11.10 (3.0.0.13 kernal) with GCC 4.6.1 if the library is built with optimization -O3 or -O2. The older GCC (4.5) or newer kernal -- cgit v0.12 From 7eb9d11fa238dcd6027a0bac049fb2a996df80fa Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 13 Jun 2012 15:59:24 -0500 Subject: [svn-r22460] Update CPack assignments. --- CMakeLists.txt | 48 +++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ac6f37..810ba1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -423,7 +423,7 @@ ENDIF (HDF5_ENABLE_EMBEDDED_LIBINFO) OPTION (HDF5_DISABLE_COMPILER_WARNINGS "Disable compiler warnings" OFF) IF (HDF5_DISABLE_COMPILER_WARNINGS) # MSVC uses /w to suppress warnings. It also complains if another - # warning level is given, so remove it.CMAKE_NO_STD_NAMESPACE + # warning level is given, so remove it. IF (MSVC) SET (HDF5_WARNINGS_BLOCKED 1) STRING (REGEX REPLACE "(^| )([/-])W[0-9]( |$)" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") @@ -667,6 +667,12 @@ IF (WIN32 AND NOT CYGWIN) ENDIF (HDF5_ENABLE_THREADSAFE) ENDIF (WIN32 AND NOT CYGWIN) +# ----------------------------------------------------------------------- +# wrapper script variables +# +#SET (CFLAGS "${C_DEFINES}") +#SET (CXXFLAGS "${CXX_DEFINES}") + #----------------------------------------------------------------------------- # Add the HDF5 Library Target to the build #----------------------------------------------------------------------------- @@ -739,6 +745,12 @@ IF (EXISTS "${HDF5_SOURCE_DIR}/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/for IF (HDF5_BUILD_FORTRAN) OPTION (HDF5_ENABLE_F2003 "Enable FORTRAN 2003 Standard" OFF) INCLUDE (${HDF5_RESOURCES_DIR}/HDF5UseFortran.cmake) + + # ----------------------------------------------------------------------- + # wrapper script variables + # +# SET (FCFLAGS "${Fortran_DEFINES}") + ADD_SUBDIRECTORY (${HDF5_SOURCE_DIR}/fortran ${PROJECT_BINARY_DIR}/fortran) IF (HDF5_BUILD_HL_LIB) IF (EXISTS "${HDF5_SOURCE_DIR}/hl/fortran" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/hl/fortran") @@ -950,7 +962,7 @@ ENDIF (NOT HDF5_EXTERNALLY_CONFIGURED) # Set the cpack variables #----------------------------------------------------------------------------- IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) - SET (CPACK_PACKAGE_VENDOR "HDF Group") + SET (CPACK_PACKAGE_VENDOR "HDF_Group") SET (CPACK_PACKAGE_NAME "${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_INSTALL_DIRECTORY "${HDF5_PACKAGE_NAME}") SET (CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${HDF5_PACKAGE_NAME}-${HDF5_PACKAGE_VERSION}-${LIB_TYPE}") @@ -964,15 +976,41 @@ IF (NOT HDF5_EXTERNALLY_CONFIGURED AND NOT HDF5_NO_PACKAGES) SET (CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/release_docs/RELEASE.txt") ENDIF (EXISTS "${HDF5_SOURCE_DIR}/release_docs") SET (CPACK_PACKAGE_RELOCATABLE TRUE) + IF (WIN32) SET (CPACK_MONOLITHIC_INSTALL ON) - SET (CPACK_NSIS_CONTACT "help@hdfgroup.org") + SET (CPACK_NSIS_CONTACT "${HDF5_PACKAGE_BUGREPORT}") SET (CPACK_NSIS_MODIFY_PATH ON) SET (CPACK_NSIS_PACKAGE_NAME "HDF5 ${HDF5_PACKAGE_VERSION}") ELSE (WIN32) - SET (CPACK_RPM_COMPONENT_INSTALL ON) - SET (CPACK_ARCHIVE_COMPONENT_INSTALL ON) + SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr") SET (CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE ON) + + SET (CPACK_DEBIAN_PACKAGE_SECTION "Libraries") + SET (CPACK_DEBIAN_PACKAGE_MAINTAINER "${HDF5_PACKAGE_BUGREPORT}") + + SET (CPACK_RPM_COMPONENT_INSTALL ON) + SET (CPACK_RPM_PACKAGE_RELOCATABLE ON) + SET (CPACK_RPM_PACKAGE_LICENSE "BSD-style") + SET (CPACK_RPM_PACKAGE_GROUP "Development/Libraries") + SET (CPACK_RPM_PACKAGE_URL "${HDF5_PACKAGE_URL}") + SET (CPACK_RPM_PACKAGE_SUMMARY "HDF5 is a unique technology suite that makes possible the management of extremely large and complex data collections.") + SET (CPACK_RPM_PACKAGE_DESCRIPTION + "The HDF5 technology suite includes: + + * A versatile data model that can represent very complex data objects and a wide variety of metadata. + + * A completely portable file format with no limit on the number or size of data objects in the collection. + + * A software library that runs on a range of computational platforms, from laptops to massively parallel systems, and implements a high-level API with C, C++, Fortran 90, and Java interfaces. + + * A rich set of integrated performance features that allow for access time and storage space optimizations. + + * Tools and applications for managing, manipulating, viewing, and analyzing the data in the collection. + +The HDF5 data model, file format, API, library, and tools are open and distributed without charge. +" + ) ENDIF (WIN32) INCLUDE(InstallRequiredSystemLibraries) -- cgit v0.12 From 603fc9dbe09270f3686d776ef6f8243c9954cddc Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 15 Jun 2012 08:26:33 -0500 Subject: [svn-r22464] Correct name used for POSIX flag --- config/cmake/ConfigureChecks.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index bbd310e..6fb9ec1 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -411,7 +411,13 @@ SET (LINUX_LFS 0) SET (HDF5_EXTRA_FLAGS) IF (NOT WINDOWS) # Linux Specific flags - SET (HDF5_EXTRA_FLAGS -D_POSIX_SOURCE=199506L -D_BSD_SOURCE) + # This was originally defined as _POSIX_SOURCE which was updated to + # _POSIX_C_SOURCE=199506L to expose a greater amount of POSIX + # functionality so clock_gettime and CLOCK_MONOTONIC are defined + # correctly. + # POSIX feature information can be found in the gcc manual at: + # http://www.gnu.org/s/libc/manual/html_node/Feature-Test-Macros.html + SET (HDF5_EXTRA_FLAGS -D_POSIX_C_SOURCE=199506L -D_BSD_SOURCE) OPTION (HDF5_ENABLE_LARGE_FILE "Enable support for large (64-bit) files on Linux." ON) IF (HDF5_ENABLE_LARGE_FILE) SET (msg "Performing TEST_LFS_WORKS") -- cgit v0.12 From 79b36622aacb480870340e494a62de8315f8662d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Jun 2012 12:29:44 -0500 Subject: [svn-r22469] MinGW Flags need to use dash set WINSOCK2_H do not test for endianess Tested: windows 32 minGW --- config/cmake/ConfigureChecks.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 6fb9ec1..2b64a56 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -121,12 +121,13 @@ IF (WIN32) IF (MINGW) SET (H5_HAVE_MINGW 1) SET (WINDOWS 1) # MinGW tries to imitate Windows + SET (CMAKE_REQUIRED_FLAGS "-DWIN32_LEAN_AND_MEAN=1 -DNOGDI=1") ENDIF (MINGW) SET (H5_HAVE_WIN32_API 1) SET (CMAKE_REQUIRED_LIBRARIES "ws2_32.lib;wsock32.lib") - SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") IF (NOT UNIX AND NOT CYGWIN AND NOT MINGW) SET (WINDOWS 1) + SET (CMAKE_REQUIRED_FLAGS "/DWIN32_LEAN_AND_MEAN=1 /DNOGDI=1") IF (MSVC) SET (H5_HAVE_VISUAL_STUDIO 1) ENDIF (MSVC) @@ -172,7 +173,9 @@ IF (WINDOWS) SET (H5_HAVE_TIMEZONE 1) SET (H5_HAVE_GETTIMEOFDAY 1) SET (H5_LONE_COLON 0) - + IF (MINGW) + SET (H5_HAVE_WINSOCK2_H 1) + ENDIF (MINGW) SET (H5_HAVE_LIBWS2_32 1) SET (H5_HAVE_LIBWSOCK32 1) ENDIF (WINDOWS) @@ -217,7 +220,9 @@ IF (WINDOWS) SET (USE_INCLUDES ${USE_INCLUDES} "windows.h") ENDIF (WINDOWS) -TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) +IF (NOT WINDOWS) + TEST_BIG_ENDIAN(H5_WORDS_BIGENDIAN) +ENDIF (NOT WINDOWS) # For other specific tests, use this MACRO. MACRO (HDF5_FUNCTION_TEST OTHER_TEST) -- cgit v0.12 From 860fe3d4d78e7f1b130b39bf410b5c8f55ad1123 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Jun 2012 13:01:57 -0500 Subject: [svn-r22470] Allow MinGW checks for fseek and the like Tested: windows 32 mingw --- config/cmake/ConfigureChecks.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/ConfigureChecks.cmake b/config/cmake/ConfigureChecks.cmake index 2b64a56..0940418 100644 --- a/config/cmake/ConfigureChecks.cmake +++ b/config/cmake/ConfigureChecks.cmake @@ -461,7 +461,7 @@ ADD_DEFINITIONS (${HDF5_EXTRA_FLAGS}) #----------------------------------------------------------------------------- # Check for HAVE_OFF64_T functionality #----------------------------------------------------------------------------- -IF (NOT WINDOWS) +IF (NOT WINDOWS OR MINGW) HDF5_FUNCTION_TEST (HAVE_OFF64_T) IF (H5_HAVE_OFF64_T) CHECK_FUNCTION_EXISTS (lseek64 H5_HAVE_LSEEK64) @@ -478,7 +478,7 @@ IF (NOT WINDOWS) CHECK_FUNCTION_EXISTS (fstat64 H5_HAVE_FSTAT64) CHECK_FUNCTION_EXISTS (stat64 H5_HAVE_STAT64) ENDIF (HAVE_STAT64_STRUCT) -ENDIF (NOT WINDOWS) +ENDIF (NOT WINDOWS OR MINGW) #----------------------------------------------------------------------------- # Check the size in bytes of all the int and float types -- cgit v0.12 From 9b63d7d5131d02369af498f7930183138535fa80 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 18 Jun 2012 15:01:59 -0500 Subject: [svn-r22471] Add check for MINGW - ws2_32 library Tested: windows - mingw --- config/cmake/H5pubconf.h.in | 3 +++ configure | 65 ++++++++++++++++++++++++++++++++++++++++++++- configure.in | 4 +++ src/H5config.h.in | 3 +++ 4 files changed, 74 insertions(+), 1 deletion(-) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 0c6cc0b..6fca1ae 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -260,6 +260,9 @@ /* Define to 1 if you have the `sz' library (-lsz). */ #cmakedefine H5_HAVE_LIBSZ @H5_HAVE_LIBSZ@ +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#cmakedefine H5_HAVE_LIBWS2_32 @H5_HAVE_LIBWS2_32@ + /* Define to 1 if you have the `z' library (-lz). */ #cmakedefine H5_HAVE_LIBZ @H5_HAVE_LIBZ@ diff --git a/configure b/configure index 515a9e4..f1fa27f 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 22430 2012-06-04 17:05:02Z byrn . +# From configure.in Id: configure.in 22448 2012-06-10 13:53:06Z hdftest . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.68 for HDF5 1.9.122. # @@ -22271,6 +22271,69 @@ fi done ;; + MINGW*) + for ac_header in io.h winsock2.h sys/timeb.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 +$as_echo_n "checking for main in -lws2_32... " >&6; } +if ${ac_cv_lib_ws2_32_main+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lws2_32 $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + +#ifdef FC_DUMMY_MAIN +#ifndef FC_DUMMY_MAIN_EQ_F77 +# ifdef __cplusplus + extern "C" +# endif + int FC_DUMMY_MAIN() { return 1; } +#endif +#endif +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ws2_32_main=yes +else + ac_cv_lib_ws2_32_main=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 +$as_echo "$ac_cv_lib_ws2_32_main" >&6; } +if test "x$ac_cv_lib_ws2_32_main" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBWS2_32 1 +_ACEOF + + LIBS="-lws2_32 $LIBS" + +fi +ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main + + ;; *) for ac_header in io.h winsock2.h sys/timeb.h do : diff --git a/configure.in b/configure.in index 3dc354b..6f8a3e9 100644 --- a/configure.in +++ b/configure.in @@ -1286,6 +1286,10 @@ case "`uname`" in CYGWIN*) AC_CHECK_HEADERS([io.h sys/timeb.h]) ;; + MINGW*) + AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) + AC_HAVE_LIBRARY([ws2_32]) + ;; *) AC_CHECK_HEADERS([io.h winsock2.h sys/timeb.h]) ;; diff --git a/src/H5config.h.in b/src/H5config.h.in index 6176b33..a2b75df 100644 --- a/src/H5config.h.in +++ b/src/H5config.h.in @@ -217,6 +217,9 @@ /* Define to 1 if you have the `sz' library (-lsz). */ #undef HAVE_LIBSZ +/* Define to 1 if you have the `ws2_32' library (-lws2_32). */ +#undef HAVE_LIBWS2_32 + /* Define to 1 if you have the `z' library (-lz). */ #undef HAVE_LIBZ -- cgit v0.12 From d0347999e6a7bd9ee2284f91a0fb77cf1527deb6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Jun 2012 09:38:23 -0500 Subject: [svn-r22477] Removed subfolder tools from install command, need to correct install template --- config/cmake/hdf5-config.cmake.install.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/cmake/hdf5-config.cmake.install.in b/config/cmake/hdf5-config.cmake.install.in index 268d5ed..a851915 100644 --- a/config/cmake/hdf5-config.cmake.install.in +++ b/config/cmake/hdf5-config.cmake.install.in @@ -43,8 +43,8 @@ IF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) ENDIF (HDF5_BUILD_HL_LIB AND HDF5_BUILD_CPP_LIB) IF (HDF5_BUILD_TOOLS) - SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include/tools" ) - SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin/tools" ) + SET (HDF5_INCLUDE_DIR_TOOLS "${_IMPORT_PREFIX}/include" ) + SET (HDF5_TOOLS_DIR "${_IMPORT_PREFIX}/bin" ) ENDIF (HDF5_BUILD_TOOLS) #----------------------------------------------------------------------------- -- cgit v0.12 From b608652f7e6469550a5c7433ca8c3186ec26b7c3 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 20 Jun 2012 09:43:02 -0500 Subject: [svn-r22479] Remove subfolder tools from install command --- hl/tools/CMakeLists.txt | 2 +- tools/h5copy/CMakeLists.txt | 4 ++-- tools/h5diff/CMakeLists.txt | 8 ++++---- tools/h5dump/CMakeLists.txt | 4 ++-- tools/h5import/CMakeLists.txt | 4 ++-- tools/h5jam/CMakeLists.txt | 4 ++-- tools/h5ls/CMakeLists.txt | 4 ++-- tools/h5repack/CMakeLists.txt | 4 ++-- tools/h5stat/CMakeLists.txt | 4 ++-- tools/lib/CMakeLists.txt | 13 ------------- tools/misc/CMakeLists.txt | 15 +++++++++++---- 11 files changed, 30 insertions(+), 36 deletions(-) diff --git a/hl/tools/CMakeLists.txt b/hl/tools/CMakeLists.txt index 4fc83b7..28943d6 100644 --- a/hl/tools/CMakeLists.txt +++ b/hl/tools/CMakeLists.txt @@ -54,7 +54,7 @@ INSTALL ( gif2h5 h52gif RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT hltoolsapplications ) diff --git a/tools/h5copy/CMakeLists.txt b/tools/h5copy/CMakeLists.txt index b56f8c7..94eb732 100644 --- a/tools/h5copy/CMakeLists.txt +++ b/tools/h5copy/CMakeLists.txt @@ -375,13 +375,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5copy RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5diff/CMakeLists.txt b/tools/h5diff/CMakeLists.txt index a962ceb..3357b97 100644 --- a/tools/h5diff/CMakeLists.txt +++ b/tools/h5diff/CMakeLists.txt @@ -1429,26 +1429,26 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5diff RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) IF (H5_HAVE_PARALLEL) - INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) + INSTALL_PROGRAM_PDB (ph5diff ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS ph5diff RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5dump/CMakeLists.txt b/tools/h5dump/CMakeLists.txt index 0976bc3..debbb48 100644 --- a/tools/h5dump/CMakeLists.txt +++ b/tools/h5dump/CMakeLists.txt @@ -1758,13 +1758,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5dump ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5dump RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5import/CMakeLists.txt b/tools/h5import/CMakeLists.txt index f5dabef..0f0cc20 100644 --- a/tools/h5import/CMakeLists.txt +++ b/tools/h5import/CMakeLists.txt @@ -262,13 +262,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5import ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5import RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5jam/CMakeLists.txt b/tools/h5jam/CMakeLists.txt index 4d81d72..d0bf30f 100644 --- a/tools/h5jam/CMakeLists.txt +++ b/tools/h5jam/CMakeLists.txt @@ -535,13 +535,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5jam ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5jam h5unjam RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5ls/CMakeLists.txt b/tools/h5ls/CMakeLists.txt index 4c21eee..81a6787 100644 --- a/tools/h5ls/CMakeLists.txt +++ b/tools/h5ls/CMakeLists.txt @@ -434,13 +434,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5ls ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5ls RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5repack/CMakeLists.txt b/tools/h5repack/CMakeLists.txt index b182332..936559e 100644 --- a/tools/h5repack/CMakeLists.txt +++ b/tools/h5repack/CMakeLists.txt @@ -899,13 +899,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5repack ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5repack RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/h5stat/CMakeLists.txt b/tools/h5stat/CMakeLists.txt index fa9f815..e8d75e3 100644 --- a/tools/h5stat/CMakeLists.txt +++ b/tools/h5stat/CMakeLists.txt @@ -206,13 +206,13 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5stat ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5stat RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) diff --git a/tools/lib/CMakeLists.txt b/tools/lib/CMakeLists.txt index 2367911..6d48d5f 100644 --- a/tools/lib/CMakeLists.txt +++ b/tools/lib/CMakeLists.txt @@ -75,19 +75,6 @@ IF (APPLE) ENDIF (HDF5_BUILD_WITH_INSTALL_NAME) ENDIF (APPLE) -IF (MSVC) - GET_TARGET_PROPERTY (target_name ${HDF5_TOOLS_LIB_TARGET} RELWITHDEBINFO_OUTPUT_NAME) - MESSAGE (STATUS "target_name is ${target_name} with config ${CMAKE_BUILD_TYPE}") - INSTALL ( - FILES - ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CMAKE_IMPORT_LIBRARY_PREFIX}${target_name}.pdb - DESTINATION - ${HDF5_INSTALL_LIB_DIR} - CONFIGURATIONS RelWithDebInfo - COMPONENT toolslibraries - ) - ENDIF (MSVC) - #----------------------------------------------------------------------------- # Add Target(s) to CMake Install for import into other projects #----------------------------------------------------------------------------- diff --git a/tools/misc/CMakeLists.txt b/tools/misc/CMakeLists.txt index b634b47..0687323 100644 --- a/tools/misc/CMakeLists.txt +++ b/tools/misc/CMakeLists.txt @@ -31,6 +31,13 @@ SET (H5_DEP_EXECUTABLES h5mkgrp ) +#----------------------------------------------------------------------------- +# Generate the h5cc file containing settings needed to compile programs +#----------------------------------------------------------------------------- +#IF (NOT WIN32) +# CONFIGURE_FILE (${HDF5_TOOLS_MISC_SOURCE_DIR}/h5cc.in ${HDF5_BINARY_DIR}/h5cc @ONLY) +#ENDIF (NOT WIN32) + ############################################################################## ############################################################################## ### T E S T I N G ### @@ -312,15 +319,15 @@ ENDIF (BUILD_TESTING) # Rules for Installation of tools using make Install target #----------------------------------------------------------------------------- -INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) -INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) -INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR}/tools toolsapplications) +INSTALL_PROGRAM_PDB (h5debug ${HDF5_INSTALL_BIN_DIR} toolsapplications) +INSTALL_PROGRAM_PDB (h5repart ${HDF5_INSTALL_BIN_DIR} toolsapplications) +INSTALL_PROGRAM_PDB (h5mkgrp ${HDF5_INSTALL_BIN_DIR} toolsapplications) INSTALL ( TARGETS h5debug h5repart h5mkgrp RUNTIME DESTINATION - ${HDF5_INSTALL_BIN_DIR}/tools + ${HDF5_INSTALL_BIN_DIR} COMPONENT toolsapplications ) -- cgit v0.12 From 24b1316f8b91a4ac2fd27668c56a96b04412c191 Mon Sep 17 00:00:00 2001 From: Elena Pourmal Date: Sat, 23 Jun 2012 18:31:40 -0500 Subject: [svn-r22482] Maintenance: - Fixed a typo in return value of the nh5dread_f_c function ( was 1 instead of 0 on success); fixed the return value to make it consistent with other Fortran functions; cleaned the code from debug statements. Platforms tested: jam with GNU and Intel compilers, fortran 2003 feature. --- fortran/src/H5Df.c | 24 +----------------------- release_docs/RELEASE.txt | 6 ++++++ 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index e1aa98e..ab7adf7 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -2401,16 +2401,6 @@ nh5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t c_xfer_prp; herr_t status; -/* int i, j; */ -/* typedef struct { */ -/* int x; */ -/* float y; */ -/* } r_dual_c; */ - -/* r_dual_c *name=buf; */ - -/* r_dual_c access[4][4]; */ - c_dset_id = (hid_t)*dset_id; c_mem_type_id = (hid_t)*mem_type_id; c_mem_space_id = (hid_t)*mem_space_id; @@ -2419,22 +2409,10 @@ nh5dread_f_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, /* * Call H5Dread function. */ - -/* printf("%i %i %i %i %i \n",c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp); */ - status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf); if ( status < 0 ) return ret_value; -/* for ( i=0; i<4; ++i) */ -/* for (j = 0; j<4; ++j) { */ -/* access[i][j] = name[i*4+j]; */ -/* /\* access[i].x = access[i].x + 1; *\/ */ -/* printf("x = %i \n", access[i][j].x); */ -/* printf("y = %f \n", access[i][j].y); */ -/* } */ - - - ret_value = 1; + ret_value = 0; return ret_value; } /****if* H5Df/nh5dget_access_plist_c diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 93d2dd1..bfce039 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -693,6 +693,12 @@ Bug Fixes since HDF5-1.8.0 release (ADB - 2011/08/15) - perf_serial test added to Windows projects and check batch file. (ADB - 2009/06/11) + Fortran + -------- + - Fixed a typo in return value of the nh5dread_f_c function ( was 1 + instead of 0 on success); fixed the return value to make it consistent + with other Fortran functions; cleaned the code from debug statements. + (EIP - 2012/06/23) Tools ----- -- cgit v0.12 From 5f8d6d5bb53da6221616e02cef4dbd6d680d9185 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 23 Jun 2012 18:32:02 -0500 Subject: [svn-r22484] Description: Copy the file image test file from the source directory to the build directory, instead of trying to open the [in-memory] file R/W. Also, clean up a few other test files that were left lying around from other tests. Tested on: MacOSX/64 10.7.4 (amazon) w/debug Too minor to require h5committest --- hl/test/Makefile.am | 6 +++--- test/Makefile.am | 7 ++++--- test/file_image.c | 30 +++++++++++++++--------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/hl/test/Makefile.am b/hl/test/Makefile.am index 76c6f90..8893b93 100644 --- a/hl/test/Makefile.am +++ b/hl/test/Makefile.am @@ -44,8 +44,8 @@ if BUILD_ALL_CONDITIONAL endif # Temporary files. These files are the ones created by running `make test'. -CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_image[1-3].h5 \ - file_img[1-2].h5 test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ - test_packet_compress.h5 test_detach.h5 +CHECK_CLEANFILES+=combine_tables[1-2].h5 test_ds[1-9].h5 test_ds10.h5 \ + test_image[1-3].h5 file_img[1-2].h5 test_lite[1-4].h5 test_table.h5 \ + test_packet_table.h5 test_packet_compress.h5 test_detach.h5 include $(top_srcdir)/config/conclude.am diff --git a/test/Makefile.am b/test/Makefile.am index 50ca89c..f1ef97e 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -108,11 +108,11 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ - sys_file1 tfile[1-5].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ + sys_file1 tfile[1-6].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ - stdio.h5 sec2.h5 dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 \ + stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0]dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 flush.h5 \ @@ -126,7 +126,8 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ - new_multi_file_v16-s.h5 + split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ + file_image_core_test.h5.copy new_multi_file_v16-s.h5 # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ diff --git a/test/file_image.c b/test/file_image.c index a846a3c..73c901e 100644 --- a/test/file_image.c +++ b/test/file_image.c @@ -519,7 +519,7 @@ test_core(void) udata_t *udata; unsigned char *file_image; char filename[1024]; - char src_dir_filename[1024]; + char copied_filename[1024]; const char *tmp = NULL; size_t size; hsize_t dims[2]; @@ -542,16 +542,15 @@ test_core(void) tmp = h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); VERIFY(tmp != NULL, "h5_fixname failed"); - /* convert file name to srcdir file name. Make a copy as - * H5_get_srcdir_filename() simply sets up the file name in its - * own buffer each time it is called -- overwriting the previous - * value. - */ - tmp = H5_get_srcdir_filename(filename); - VERIFY(tmp != NULL, "H5_get_srcdir_filename failed"); - VERIFY(strlen(tmp) < 1023, "srcdir file name too long."); - HDstrncpy(src_dir_filename, tmp, 1023); - src_dir_filename[1023] = '\0'; + /* Append ".copy" to the filename from the source directory */ + VERIFY(HDstrlen(filename) < (1023 - 5), "file name too long."); + HDstrncpy(copied_filename, filename, 1023); + copied_filename[1023] = '\0'; + HDstrcat(copied_filename, ".copy"); + + /* Make a copy of the data file from svn. */ + ret = h5_make_local_copy(filename, copied_filename); + VERIFY(ret >= 0, "h5_make_local_copy"); /* Allocate and initialize udata */ udata = (udata_t *)HDmalloc(sizeof(udata_t)); @@ -566,7 +565,7 @@ test_core(void) /* Test open (no file image) */ reset_udata(udata); - file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + file = H5Fopen(copied_filename, H5F_ACC_RDONLY, fapl); VERIFY(file >= 0, "H5Fopen failed"); VERIFY(udata->used_callbacks == MALLOC, "opening a core file used the wrong callbacks"); VERIFY(udata->malloc_src == H5FD_FILE_IMAGE_OP_FILE_OPEN, "Malloc callback came from wrong sourc in core open"); @@ -579,7 +578,7 @@ test_core(void) VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Reopen file */ - file = H5Fopen(src_dir_filename, H5F_ACC_RDWR, fapl); + file = H5Fopen(copied_filename, H5F_ACC_RDWR, fapl); VERIFY(file >= 0, "H5Fopen failed"); /* Set up a new dset */ @@ -613,7 +612,7 @@ test_core(void) VERIFY(udata->free_src == H5FD_FILE_IMAGE_OP_FILE_CLOSE, "Free callback came from wrong sourc in core close"); /* Create file image buffer */ - fd = HDopen(src_dir_filename, O_RDONLY, 0666); + fd = HDopen(copied_filename, O_RDONLY, 0666); VERIFY(fd > 0, "open failed"); ret = HDfstat(fd, &sb); VERIFY(ret == 0, "fstat failed"); @@ -627,13 +626,14 @@ test_core(void) if(H5Pset_file_image(fapl, file_image, size) < 0) FAIL_STACK_ERROR /* Test open with file image */ - if((file = H5Fopen("dne.h5", H5F_ACC_RDWR, fapl)) < 0) FAIL_STACK_ERROR + if((file = H5Fopen("dne.h5", H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR if(H5Fclose(file) < 0) FAIL_STACK_ERROR /* Release resources */ h5_cleanup(FILENAME, fapl); HDfree(udata); HDfree(file_image); + HDremove(copied_filename); PASSED(); -- cgit v0.12 From 76c13682e4bb9c43e59c71fcaaf760e619a59e66 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 23 Jun 2012 18:42:09 -0500 Subject: [svn-r22486] Description: Fix typo with last change and reformat a little bit --- test/Makefile.am | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index f1ef97e..cb56d52 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -112,7 +112,7 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse stab.h5 extern_[1-3].h5 extern_[1-4][ab].raw gheap[0-4].h5 \ dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 tmp \ big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ - stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0]dt_arith[1-2].h5 tattr.h5 \ + stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 flush.h5 \ @@ -125,9 +125,10 @@ CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offse dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ - earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ + earray.h5 efc[0-5].h5 log_vfd_out.log \ + new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ - file_image_core_test.h5.copy new_multi_file_v16-s.h5 + file_image_core_test.h5.copy # Sources for testhdf5 executable testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ -- cgit v0.12 From 02a0bd53e89c79508899ef28bfb7f038a1612aa7 Mon Sep 17 00:00:00 2001 From: HDF Tester Date: Sun, 24 Jun 2012 09:29:36 -0500 Subject: [svn-r22487] Snapshot version 1.9 release 122 --- README.txt | 2 +- c++/src/Makefile.in | 2 +- config/lt_vers.am | 2 +- configure | 24 ++++++++++++------------ configure.in | 2 +- fortran/src/Makefile.in | 2 +- hl/c++/src/Makefile.in | 2 +- hl/fortran/src/Makefile.in | 2 +- hl/src/Makefile.in | 2 +- hl/test/Makefile.in | 6 +++--- release_docs/RELEASE.txt | 2 +- src/H5public.h | 4 ++-- src/Makefile.in | 2 +- test/Makefile.in | 32 +++++++++++++++++--------------- vms/src/h5pubconf.h | 6 +++--- windows/src/H5pubconf.h | 6 +++--- 16 files changed, 50 insertions(+), 48 deletions(-) diff --git a/README.txt b/README.txt index 7b77f8e..0186b6f 100644 --- a/README.txt +++ b/README.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.122 currently under development +HDF5 version 1.9.123 currently under development Please refer to the release_docs/INSTALL file for installation instructions. ------------------------------------------------------------------------------ diff --git a/c++/src/Makefile.in b/c++/src/Makefile.in index c265924..544c719 100644 --- a/c++/src/Makefile.in +++ b/c++/src/Makefile.in @@ -431,7 +431,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 # Include src directory diff --git a/config/lt_vers.am b/config/lt_vers.am index 48f0d67..9d32ebd 100644 --- a/config/lt_vers.am +++ b/config/lt_vers.am @@ -17,7 +17,7 @@ # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 ## If the API changes *at all*, increment LT_VERS_INTERFACE and diff --git a/configure b/configure index f1fa27f..ea85c37 100755 --- a/configure +++ b/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Id: configure.in 22448 2012-06-10 13:53:06Z hdftest . +# From configure.in Id: configure.in 22471 2012-06-18 20:01:59Z byrn . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for HDF5 1.9.122. +# Generated by GNU Autoconf 2.68 for HDF5 1.9.123. # # Report bugs to . # @@ -571,8 +571,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='HDF5' PACKAGE_TARNAME='hdf5' -PACKAGE_VERSION='1.9.122' -PACKAGE_STRING='HDF5 1.9.122' +PACKAGE_VERSION='1.9.123' +PACKAGE_STRING='HDF5 1.9.123' PACKAGE_BUGREPORT='help@hdfgroup.org' PACKAGE_URL='' @@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures HDF5 1.9.122 to adapt to many kinds of systems. +\`configure' configures HDF5 1.9.123 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1533,7 +1533,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of HDF5 1.9.122:";; + short | recursive ) echo "Configuration of HDF5 1.9.123:";; esac cat <<\_ACEOF @@ -1726,7 +1726,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -HDF5 configure 1.9.122 +HDF5 configure 1.9.123 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2815,7 +2815,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by HDF5 $as_me 1.9.122, which was +It was created by HDF5 $as_me 1.9.123, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -3636,7 +3636,7 @@ fi # Define the identity of the package. PACKAGE='hdf5' - VERSION='1.9.122' + VERSION='1.9.123' cat >>confdefs.h <<_ACEOF @@ -30668,7 +30668,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by HDF5 $as_me 1.9.122, which was +This file was extended by HDF5 $as_me 1.9.123, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -30734,7 +30734,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -HDF5 config.status 1.9.122 +HDF5 config.status 1.9.123 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" @@ -33529,7 +33529,7 @@ Usage: $0 [OPTIONS] Report bugs to ." lt_cl_version="\ -HDF5 config.lt 1.9.122 +HDF5 config.lt 1.9.123 configured by $0, generated by GNU Autoconf 2.68. Copyright (C) 2010 Free Software Foundation, Inc. diff --git a/configure.in b/configure.in index 6f8a3e9..953c488 100644 --- a/configure.in +++ b/configure.in @@ -26,7 +26,7 @@ dnl dnl NOTE: Don't forget to change the version number here when we do a dnl release!!! dnl -AC_INIT([HDF5], [1.9.122], [help@hdfgroup.org]) +AC_INIT([HDF5], [1.9.123], [help@hdfgroup.org]) AC_CONFIG_SRCDIR([src/H5.c]) AM_CONFIG_HEADER([src/H5config.h]) diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in index 46ffc46..dc267f8 100644 --- a/fortran/src/Makefile.in +++ b/fortran/src/Makefile.in @@ -478,7 +478,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 # Include src directory in both Fortran and C flags (C compiler is used diff --git a/hl/c++/src/Makefile.in b/hl/c++/src/Makefile.in index cae86d3..5c4d5f7 100644 --- a/hl/c++/src/Makefile.in +++ b/hl/c++/src/Makefile.in @@ -421,7 +421,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 # Include src directory diff --git a/hl/fortran/src/Makefile.in b/hl/fortran/src/Makefile.in index 4644586..3685893 100644 --- a/hl/fortran/src/Makefile.in +++ b/hl/fortran/src/Makefile.in @@ -436,7 +436,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/hl/src -I$(top_builddir)/hl/src \ -I$(top_srcdir)/fortran/src -I$(top_builddir)/fortran/src diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index bc88d4d..adc4ee1 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -420,7 +420,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 # This library is our main target. diff --git a/hl/test/Makefile.in b/hl/test/Makefile.in index b7548ec..be0338a 100644 --- a/hl/test/Makefile.in +++ b/hl/test/Makefile.in @@ -427,9 +427,9 @@ TRACE = perl $(top_srcdir)/bin/trace # Temporary files. These files are the ones created by running `make test'. CHECK_CLEANFILES = *.chkexe *.chklog *.clog combine_tables[1-2].h5 \ - test_ds[1-9].h5 test_image[1-3].h5 file_img[1-2].h5 \ - test_lite[1-2].h5 test_table.h5 test_packet_table.h5 \ - test_packet_compress.h5 test_detach.h5 + test_ds[1-9].h5 test_ds10.h5 test_image[1-3].h5 \ + file_img[1-2].h5 test_lite[1-4].h5 test_table.h5 \ + test_packet_table.h5 test_packet_compress.h5 test_detach.h5 # The tests depend on the hdf5, hdf5 test, and hdf5_hl libraries LDADD = $(LIBH5_HL) $(LIBH5TEST) $(LIBHDF5) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index bfce039..e1913d0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -1,4 +1,4 @@ -HDF5 version 1.9.122 currently under development +HDF5 version 1.9.123 currently under development ================================================================================ diff --git a/src/H5public.h b/src/H5public.h index 7d834de..deedbf8 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -75,10 +75,10 @@ extern "C" { /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ -#define H5_VERS_RELEASE 122 /* For tweaks, bug-fixes, or development */ +#define H5_VERS_RELEASE 123 /* For tweaks, bug-fixes, or development */ #define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */ /* Empty string for real releases. */ -#define H5_VERS_INFO "HDF5 library version: 1.9.122" /* Full version string */ +#define H5_VERS_INFO "HDF5 library version: 1.9.123" /* Full version string */ #define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \ H5_VERS_RELEASE) diff --git a/src/Makefile.in b/src/Makefile.in index c06f8d8..6b1df70 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -484,7 +484,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 112 +LT_VERS_REVISION = 113 LT_VERS_AGE = 0 H5detect_CFLAGS = -g $(AM_CFLAGS) diff --git a/test/Makefile.in b/test/Makefile.in index 626a029..ede709c 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -750,25 +750,27 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog accum.h5 cmpd_dset.h5 \ max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_expand.h5 \ copy_dcpl_newfile.h5 extend.h5 istore.h5 extlinks*.h5 \ - frspace.h5 links*.h5 sys_file1 tfile[1-5].h5 th5s[1-4].h5 \ + frspace.h5 links*.h5 sys_file1 tfile[1-6].h5 th5s[1-4].h5 \ lheap.h5 fheap.h5 ohdr.h5 stab.h5 extern_[1-3].h5 \ extern_[1-4][ab].raw gheap[0-4].h5 dt_arith[1-2] links.h5 \ links[0-6]*.h5 extlinks[0-15].h5 tmp big.data \ big[0-9][0-9][0-9][0-9][0-9].h5 stdio.h5 sec2.h5 \ - dtypes[0-9].h5 dt_arith[1-2].h5 tattr.h5 tselect.h5 mtime.h5 \ - unlink.h5 unicode.h5 coord.h5 fillval_[0-9].h5 fillval.raw \ - mount_[0-9].h5 testmeta.h5 ttime.h5 trefer[1-3].h5 tvltypes.h5 \ - tvlstr.h5 tvlstr2.h5 flush.h5 enum1.h5 titerate.h5 ttsafe.h5 \ - tarray1.h5 tgenprop.h5 tmisc[0-9]*.h5 set_extent[1-5].h5 \ - ext[12].bin getname.h5 getname[1-3].h5 sec2_file.h5 \ - direct_file.h5 family_file000[0-3][0-9].h5 \ - new_family_v16_000[0-3][0-9].h5 multi_file-[rs].h5 core_file \ - new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 \ - err_compat.h5 dtransform.h5 test_filters.h5 get_file_name.h5 \ - tstint[1-2].h5 unlink_chunked.h5 btree2.h5 objcopy_src.h5 \ - objcopy_dst.h5 objcopy_ext.dat trefer1.h5 trefer2.h5 \ - app_ref.h5 farray.h5 earray.h5 efc[0-5].h5 log_vfd_out.log \ - new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 + dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ + tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ + fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 \ + ttime.h5 trefer[1-3].h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 \ + flush.h5 enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ + tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin getname.h5 \ + getname[1-3].h5 sec2_file.h5 direct_file.h5 \ + family_file000[0-3][0-9].h5 new_family_v16_000[0-3][0-9].h5 \ + multi_file-[rs].h5 core_file new_move_[ab].h5 ntypes.h5 \ + dangle.h5 error_test.h5 err_compat.h5 dtransform.h5 \ + test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ + unlink_chunked.h5 btree2.h5 objcopy_src.h5 objcopy_dst.h5 \ + objcopy_ext.dat trefer1.h5 trefer2.h5 app_ref.h5 farray.h5 \ + earray.h5 efc[0-5].h5 log_vfd_out.log new_multi_file_v16-r.h5 \ + new_multi_file_v16-s.h5 split_get_file_image_test-m.h5 \ + split_get_file_image_test-r.h5 file_image_core_test.h5.copy INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src # Test script for error_test and err_compat diff --git a/vms/src/h5pubconf.h b/vms/src/h5pubconf.h index 48748b5..965f2d6 100644 --- a/vms/src/h5pubconf.h +++ b/vms/src/h5pubconf.h @@ -502,7 +502,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.122" +#define H5_PACKAGE_STRING "HDF5 1.9.123" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -511,7 +511,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.122" +#define H5_PACKAGE_VERSION "1.9.123" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "ll" @@ -674,7 +674,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.122" +#define H5_VERSION "1.9.123" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index 99f466d..a1d3308 100644 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -527,7 +527,7 @@ #define H5_PACKAGE_NAME "HDF5" /* Define to the full name and version of this package. */ -#define H5_PACKAGE_STRING "HDF5 1.9.122" +#define H5_PACKAGE_STRING "HDF5 1.9.123" /* Define to the one symbol short name of this package. */ #define H5_PACKAGE_TARNAME "hdf5" @@ -536,7 +536,7 @@ #define H5_PACKAGE_URL "" /* Define to the version of this package. */ -#define H5_PACKAGE_VERSION "1.9.122" +#define H5_PACKAGE_VERSION "1.9.123" /* Width for printf() for type `long long' or `__int64', use `ll' */ #define H5_PRINTF_LL_WIDTH "I64" @@ -707,7 +707,7 @@ /* #undef H5_USING_MEMCHECKER */ /* Version number of package */ -#define H5_VERSION "1.9.122" +#define H5_VERSION "1.9.123" /* Define if vsnprintf() returns the correct value for formatted strings that don't fit into size allowed */ -- cgit v0.12