From 37c56ebd37652aac75634187d256d831c781c3bd Mon Sep 17 00:00:00 2001 From: Binh-Minh Ribler Date: Mon, 27 Mar 2017 23:38:35 -0500 Subject: Fix HDFFV-8089 Description: Some code within an "ifdef H5D_CHUNK_DEBUG" block was using outdated data structure but not caught because the case of H5D_CHUNK_DEBUG being defined was never tested. It was commented out. I defined H5D_CHUNK_DEBUG, tested, and commented out again. Platforms tested: Linux/32 2.6 (jam) Linux/64 (platypus) Darwin (osx1010test) --- src/H5Dchunk.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/H5Dchunk.c b/src/H5Dchunk.c index 7a646af..63e692f 100644 --- a/src/H5Dchunk.c +++ b/src/H5Dchunk.c @@ -6060,9 +6060,9 @@ H5D__chunk_stats(const H5D_t *dset, hbool_t headers) #endif if (headers) { - if (rdcc->nhits>0 || rdcc->nmisses>0) { - miss_rate = 100.0 * rdcc->nmisses / - (rdcc->nhits + rdcc->nmisses); + if (rdcc->stats.nhits>0 || rdcc->stats.nmisses>0) { + miss_rate = 100.0 * rdcc->stats.nmisses / + (rdcc->stats.nhits + rdcc->stats.nmisses); } else { miss_rate = 0.0; } @@ -6073,8 +6073,8 @@ H5D__chunk_stats(const H5D_t *dset, hbool_t headers) } fprintf(H5DEBUG(AC), " %-18s %8u %8u %7s %8d+%-9ld\n", - "raw data chunks", rdcc->nhits, rdcc->nmisses, ascii, - rdcc->ninits, (long)(rdcc->nflushes)-(long)(rdcc->ninits)); + "raw data chunks", rdcc->stats.nhits, rdcc->stats.nmisses, ascii, + rdcc->stats.ninits, (long)(rdcc->stats.nflushes)-(long)(rdcc->stats.ninits)); } done: -- cgit v0.12 From 1a114c191d6366558202522df96c2726c0512cc0 Mon Sep 17 00:00:00 2001 From: lrknox Date: Tue, 28 Mar 2017 10:06:18 -0500 Subject: Clear hdf5 1.10 entries from RELEASE.txt in the develop branch. Entries in this branch version of RELEASE.txt should be intended for the future 1.12.0 release. --- release_docs/RELEASE.txt | 359 ++++------------------------------------------- 1 file changed, 27 insertions(+), 332 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 22accd3..d2e73e0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,8 +4,8 @@ HDF5 version 1.11.0 currently under development INTRODUCTION -This document describes the differences between HDF5-1.10.0-patch1 and -HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. +This document describes the differences between HDF5-1.11.x and +HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.11.x. For more details check the HISTORY*.txt files in the HDF5 source. @@ -28,8 +28,8 @@ in 1.10.1?" document: https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.8.19 (current -release) versus Release 1.10.1 +from Release to Release" document, in the section "Release 1.10.1 (current +release) versus Release 1.11.x https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html @@ -42,7 +42,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.0-patch1 +- Bug Fixes since HDF5-1.10.1 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -54,33 +54,11 @@ New Features Configuration: ------------- - - CMake minimum is now 3.2.2. - (ADB 2017/01/10) - - - Tools folder is separated into source and test folders. This - allows autotools to skip the make command and just execute - the make check command. - (HDFFV-9719 ADB 2016/10/27) + - Library: -------- - - Paged Aggregation - - This is one of the file space management strategies. This strategy - aggregates small metadata and raw data allocations into constant-sized - well-aligned pages, which are suitable for page caching. Paged - aggregation together with the page buffering feature will allow efficient - I/O accesses. - - - Page Buffering - - The page buffering layer in the HDF5 library absorbs small accesses to - the file system. Each page in memory corresponds to a page allocated in - the file. Access to the file system is then performed as a single page - or multiple of pages, if they are contiguous. This ensures that small - accesses to the file system are avoided while providing another caching - layer for improved I/O performance. This feature works in conjunction - with the paged aggregation feature. + - Parallel Library: ----------------- @@ -96,13 +74,11 @@ New Features Tools: ------ - - Add options to h5clear: - -s: clear the status_flags field in the file's superblock - -m: Remove the metadata cache image from the file - (Pull Request #361 QK 2017/03/22) + - High-Level APIs: --------------- + - C Packet Table API ------------------ @@ -119,44 +95,16 @@ Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.0-patch1 release +Bug Fixes since HDF5-1.10.1 release ================================== Library ------- - - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY - (PR 201 ADB 2016/12/12) - - - Fix error when copying dataset with attribute which is a compound datatype - consisting of a variable length string. - (HDFFV-7991 VC 2016/08/19, 2016/08/21, 2016/08/24) - - - H5DOappend will not fail if a dataset has no append callback registered. - (HDFFV-9960 VC 2016/08/05, 2016/08/14) - - - Fix the problem where the committed datatype's file location is different - from the file location of an attribute with that committed datatype. - (HDFFV-9940 VC 2016/07/03, 2016/07/06) - - - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. - (b) Modifications to better handle error recovery when conversion by - h5format_convert fails. - (HDFFV-9434 VC 2016/05/29) + - Configuration ------------- - - Configuration will check for the strtoll and strtoull functions - before using alternatives - (PR 340 ADB 2017/03/17) - - - CMake uses a Windows pdb directory variable if available and - will generate both static and shared pdb files. - (HDFFV-9875 ADB 2017/02/06) - - - CMake now builds shared versions of tools. - (HDFFV-10123 ADB 2017/02/01) - - Performance + - ------------- - @@ -166,11 +114,7 @@ Bug Fixes since HDF5-1.10.0-patch1 release Tools ----- - - h5diff correctly ignores strpad in comparing strings. - (HDFFV-10128 ADB 2017/03/03) - - - h5repack now correctly parses the command line filter options. - (HDFFV-10046 ADB 2017/01/24) + - High-Level APIs: ------ @@ -201,18 +145,6 @@ Bug Fixes since HDF5-1.10.0-patch1 release Supported Platforms =================== - Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) - #1 SMP x86_64 GNU/Linux compilers: - (mayll/platypus) Version 4.4.7 20120313 - Version 4.8.4 - PGI C, Fortran, C++ for 64-bit target on - x86-64; - Version 16.10-0 - Intel(R) C (icc), C++ (icpc), Fortran (icc) - compilers: - Version 15.0.3.187 (Build 20150407) - MPICH 3.1.4 compiled with GCC 4.9.3 - Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) @@ -291,9 +223,7 @@ Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? Mac OS X Yosemite 10.10.5 64-bit n y/y n y y ? Mac OS X El Capitan 10.11.6 64-bit n y/y n y y ? -CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y -CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y -CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y @@ -313,9 +243,7 @@ Mac OS X Mountain Lion 10.8.5 64-bit y n y y Mac OS X Mavericks 10.9.5 64-bit y n y y Mac OS X Yosemite 10.10.5 64-bit y n y y Mac OS X El Capitan 10.11.6 64-bit y n y y -CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y -CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n -CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n +CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n Linux 2.6.32-573.18.1.el6.ppc64 y y y n @@ -328,6 +256,18 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 (ostrich) and IBM XL Fortran for Linux, V15.1 @@ -350,249 +290,4 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== -* "make check" fails on CYGWIN when building shared lib files is enabled. The - default on Cygwin has been changed to disable shared. It can be enabled with - the --enable-shared configure option but is likely to fail "make check" - with GCC compilers. (LK -2015/04/16) - -* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv - catches some undefined behavior in the alignment algorithm of the macro DETECT_I - in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment - of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for - H5detect.c. In the future, we can separate flags for H5detect.c from the rest of - the library. (SLU - 2013/10/16) - -* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It - complains with this message: - "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. - - The reason is that __func__ is a predefined identifier in C99 standard. The - HDF5 C library uses it in H5private.h. The test ttypes.cpp includes - H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 - C++ compiler doesn't support __func__, thus fails to compile the C++ test. - But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this - identifier, try to compile the following simple C++ program: - #include - - int main(void) - { - printf("%s\n", __func__); - return 0; - } - (SLU - 2012/11/5) - -* The C++ and FORTRAN bindings are not currently working on FreeBSD with the - native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the - ports (and probably gcc releases after that). - (QAK - 2012/10/19) - -* 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 - (3.2.2 on Fedora) doesn't have the problem. Users should lower down the - optimization level (-O1 or -O0) by defining CFLAGS in the command line of - "configure" like: - - CFLAGS=-O1 ./configure - - It will overwrite the library's default optimization level. (Issue 7829. - SLU - 2012/2/7) - -* --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) - -* While working on the 1.8.6 release of HDF5, a bug was discovered that can - occur when reading from a dataset in parallel shortly after it has been - written to collectively. The issue was exposed by a new test in the parallel - HDF5 test suite, but had existed before that. We believe the problem lies with - certain MPI implementations and/or filesystems. - - We have provided a pure MPI test program, as well as a standalone HDF5 - program, that can be used to determine if this is an issue on your system. - They should be run across multiple nodes with a varying number of processes. - These programs can be found at: - http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ - -* Parallel mode in AIX will fail some of the testcheck_version.sh tests where - it treats "exit(134) the same as if process 0 had received an abort signal. - This is fixed and will be available in the next release. AKC - 2009/11/3 - -* The PathScale MPI implementation, accessing a Panasas file system, would - cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not - existing. This is due to the MPI_File_open() call failing if the amode has - the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 - -* Parallel tests failed with 16 processes with data inconsistency at testphdf5 - / dataset_readAll. Parallel tests also failed with 32 and 64 processes with - collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks - with MPI IO. (CMC - 2009/04/28) - -* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel - tests failed with MPI-IO file locking message. AKC - 2007/6/25. -* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use - -mp -O1 compilation flags to build the libraries. Higher level of optimization - causes failures in several HDF5 library tests. -* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the - shared libraries (tested for 1.8.0-beta2) -* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass - and the parallel tests also pass with lots of non-fatal error messages. -* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test -* configuring with --enable-debug=all produces compiler errors on most - platforms. Users who want to run HDF5 in debug mode should use - --enable-debug rather than --enable-debug=all to enable debugging - information on most modules. -* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long - double to (unsigned) long long and from (unsigned)long long to long double. -* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 - optimization flag. -* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to - HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard - for floating-point data. -* On Cray X1, a lone colon on the command line of h5dump --xml (as in - the testh5dumpxml.sh script) is misinterpereted by the operating system - and causes an error. -* On mpich 1.2.5 and 1.2.6, we found that if more than two processes - contribute no IO and the application asks to do IO with collective, we found - that when using 4 processors, a simple collective write will be hung - sometimes. This can be verified with t_mpi test under testpar. -* The dataset created or rewritten with the v1.6.3 library or after can't - be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is - enabled. There was a bug in the calculating code of the Fletcher32 - checksum in the library before v1.6.3. The checksum value wasn't consistent - between big-endian and little-endian systems. This bug was fixed in - Release 1.6.3. However, after fixing the bug, the checksum value is no - longer the same as before on little-endian system. The library release - after 1.6.4 can still read the dataset created or rewritten with the library - of v1.6.2 or before. SLU - 2005/6/30 -* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron - processor, there's a bug in the compiler for optimization(-O2). The library - failed in several tests but all related to multi driver. The problem has - been reported to the vendor. -* On IBM AIX systems, parallel HDF5 mode will fail some tests with error - messages like "INFO: 0031-XXX ...". This is from the command poe. - Set the environment variable MP_INFOLEVEL to 0 to minimize the messages - and run the tests again. - The tests may fail with messages like "The socket name is already - in use". HDF5 does not use sockets (except for stream-VFD). This is - due to problems of the poe command trying to set up the debug socket. - Check if there are many old /tmp/s.pedb.* staying around. These are - sockets used by the poe command and left behind due to failed commands. - Ask your system administrator to clean them out. Lastly, request IBM - to provide a mean to run poe without the debug socket. - -* The C++ library's tests fails when compiling with PGI C++ compiler. The - workaround until the problem is correctly handled is to use the - flag "--instantiate=local" prior to the configure and build steps, as: - setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher - - -* The stream-vfd test uses ip port 10007 for testing. If another - application is already using that port address, the test will hang - indefinitely and has to be terminated by the kill command. To try the - test again, change the port address in test/stream_test.c to one not - being used in the host. - -* The --enable-static-exec configure flag will only statically link libraries - if the static version of that library is present. If only the shared version - of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, - for example, only have shared versions), the flag should still result in a - successful compilation, but note that the installed executables will not be - fully static. Thus, the only guarantee on these systems is that the - executable is statically linked with just the HDF5 library. - -* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during - compilation. The ANSI version of the compiler complains about not being - able to handle the `long long' datatype with the warning: - - warning: ANSI C does not support `long long' - - This warning is innocuous and can be safely ignored. - -* Certain platforms give false negatives when testing h5ls: - - Cray J90 and Cray T90IEEE give errors during testing when displaying - some floating-point values. These are benign differences due to - the different precision in the values displayed and h5ls appears to - be dumping floating-point numbers correctly. - -* Not all platforms behave correctly with szip's shared libraries. Szip is - disabled in these cases, and a message is relayed at configure time. Static - libraries should be working on all systems that support szip, and should be - used when shared libraries are unavailable. There is also a configure error - on Altix machines that incorrectly reports when a version of szip without - an encoder is being used. - -* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, - compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 - complaining about exit subroutine. Comment out the line - IF (total_error .ne. 0) CALL exit (total_error) - -* Information about building with PGI and Intel compilers is available in - INSTALL file sections 5.7 and 5.8 - -* On at least one system, (SDSC DataStar), the scheduler (in this case - LoadLeveler) sends job status updates to standard error when you run - any executable that was compiled with the parallel compilers. - - This causes problems when running "make check" on parallel builds, as - many of the tool tests function by saving the output from test runs, - and comparing it to an exemplar. - - The best solution is to reconfigure the target system so it no longer - inserts the extra text. However, this may not be practical. - - In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to - the configure and build. This will cause "make check" to continue after - detecting errors in the tool tests. However, in the case of SDSC DataStar, - it also leaves you with some 150 "failed" tests to examine by hand. - - A second solution is to write a script to run serial tests and filter - out the text added by the scheduler. A sample script used on SDSC - DataStar is given below, but you will probably have to customize it - for your installation. - - Observe that the basic idea is to insert the script as the first item - on the command line which executes the the test. The script then - executes the test and filters out the offending text before passing - it on. - - #!/bin/csh - - set STDOUT_FILE=~/bin/serial_filter.stdout - set STDERR_FILE=~/bin/serial_filter.stderr - - rm -f $STDOUT_FILE $STDERR_FILE - - ($* > $STDOUT_FILE) >& $STDERR_FILE - - set RETURN_VALUE=$status - - cat $STDOUT_FILE - - tail +3 $STDERR_FILE - - exit $RETURN_VALUE - - You get the HDF make files and test scipts to execute your filter script - by setting the environment variable "RUNSERIAL" to the full path of the - script prior to running configure for parallel builds. Remember to - "unsetenv RUNSERIAL" before running configure for a serial build. - - Note that the RUNSERIAL environment variable exists so that we can - can prefix serial runs as necessary on the target system. On DataStar, - no prefix is necessary. However on an MPICH system, the prefix might - have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to - get the serial tests to run at all. - - In such cases, you will have to include the regular prefix in your - filter script. - -* H5Ocopy() does not copy reg_ref attributes correctly when shared-message - is turn on. The value of the reference in the destination attriubte is - wrong. This H5Ocopy problem will affect h5copy tool -- cgit v0.12 From afd8f64c29f7cffde895232406a3a388c6d77e77 Mon Sep 17 00:00:00 2001 From: mainzer Date: Tue, 28 Mar 2017 11:21:40 -0500 Subject: Omnibus checkin for several relatively minor modifications: 1) Added code test/page_buffer.c to verify that page buffering is disabled in parallel builds. 2) Added code to test/cache_image.c to verify correct interaction between evict on close and cache image -- in particular management of a file containing a cache image containing dirty metadata that has been opened R/O. Also fix for the bug exposed. 3) Added code to testpar/t_cache_image.c to verify expected procedure for reading cache images, and also supporting stats collection code needed for the test. 4) Repair of an overactive sanity check in H5C__reconstruct_cache_contents(). 5) Other minor tidies in passing. Tested serial and parallel, debug and production on Jelly. --- src/H5Cdbg.c | 4 +- src/H5Cimage.c | 73 +++++--- src/H5Cpkg.h | 21 +++ src/H5Ctag.c | 47 ++++- test/cache_image.c | 467 +++++++++++++++++++++++++++++++++++++++++++++++- test/page_buffer.c | 135 +++++++++++++- testpar/t_cache_image.c | 217 ++++++++++++++++++---- 7 files changed, 886 insertions(+), 78 deletions(-) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index a955eaf..0a98406 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -738,9 +738,10 @@ H5C_stats(H5C_t * cache_ptr, (long long)(cache_ptr->index_scan_restarts)); HDfprintf(stdout, - "%s cache image creations/loads/size = %d / %d / %Hu\n", + "%s cache image creations/reads/loads/size = %d / %d /%d / %Hu\n", cache_ptr->prefix, cache_ptr->images_created, + cache_ptr->images_read, cache_ptr->images_loaded, cache_ptr->last_image_size); @@ -993,6 +994,7 @@ H5C_stats__reset(H5C_t H5_ATTR_UNUSED * cache_ptr) cache_ptr->index_scan_restarts = 0; cache_ptr->images_created = 0; + cache_ptr->images_read = 0; cache_ptr->images_loaded = 0; cache_ptr->last_image_size = (hsize_t)0; diff --git a/src/H5Cimage.c b/src/H5Cimage.c index fc58dac..d60ee05 100644 --- a/src/H5Cimage.c +++ b/src/H5Cimage.c @@ -122,7 +122,7 @@ static H5C_cache_entry_t *H5C__reconstruct_cache_entry(const H5F_t *f, H5C_t *cache_ptr, const uint8_t **buf); static herr_t H5C__write_cache_image_superblock_msg(H5F_t *f, hid_t dxpl_id, hbool_t create); -static herr_t H5C__read_cache_image(H5F_t * f, hid_t dxpl_id, const H5C_t *cache_ptr); +static herr_t H5C__read_cache_image(H5F_t * f, hid_t dxpl_id, H5C_t *cache_ptr); static herr_t H5C__write_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr); static herr_t H5C__construct_cache_image_buffer(H5F_t *f, H5C_t *cache_ptr); static herr_t H5C__free_image_entries_array(H5C_t *cache_ptr); @@ -1035,7 +1035,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) +H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -1053,31 +1053,53 @@ H5C__read_cache_image(H5F_t *f, hid_t dxpl_id, const H5C_t *cache_ptr) H5AC_aux_t *aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr; int mpi_result; - if((NULL == aux_ptr) || (aux_ptr->mpi_rank == 0)) { - HDassert((NULL == aux_ptr) || (aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC)); + if ( ( NULL == aux_ptr ) || ( aux_ptr->mpi_rank == 0 ) ) { + + HDassert((NULL == aux_ptr) || + (aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC)); #endif /* H5_HAVE_PARALLEL */ /* Read the buffer (if serial access, or rank 0 of parallel access) */ - if(H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, cache_ptr->image_len, dxpl_id, cache_ptr->image_buffer) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, "Can't read metadata cache image block") + if ( H5F_block_read(f, H5FD_MEM_SUPER, cache_ptr->image_addr, + cache_ptr->image_len, dxpl_id, + cache_ptr->image_buffer) < 0) + + HGOTO_ERROR(H5E_CACHE, H5E_READERROR, FAIL, \ + "Can't read metadata cache image block") + + H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) #ifdef H5_HAVE_PARALLEL - if(aux_ptr) { + if ( aux_ptr ) { + /* Broadcast cache image */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(cache_ptr->image_buffer, (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm))) + if ( MPI_SUCCESS != + (mpi_result = MPI_Bcast(cache_ptr->image_buffer, + (int)cache_ptr->image_len, MPI_BYTE, + 0, aux_ptr->mpi_comm)) ) + HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_result) + } /* end if */ } /* end if */ - else if(aux_ptr) { + else if ( aux_ptr ) { + /* Retrieve the contents of the metadata cache image from process 0 */ - if(MPI_SUCCESS != (mpi_result = MPI_Bcast(cache_ptr->image_buffer, (int)cache_ptr->image_len, MPI_BYTE, 0, aux_ptr->mpi_comm))) - HMPI_GOTO_ERROR(FAIL, "can't receive cache image MPI_Bcast", mpi_result) + if ( MPI_SUCCESS != + (mpi_result = MPI_Bcast(cache_ptr->image_buffer, + (int)cache_ptr->image_len, MPI_BYTE, + 0, aux_ptr->mpi_comm)) ) + + HMPI_GOTO_ERROR(FAIL, "can't receive cache image MPI_Bcast", \ + mpi_result) } /* end else-if */ } /* end block */ #endif /* H5_HAVE_PARALLEL */ done: + FUNC_LEAVE_NOAPI(ret_value) + } /* H5C__read_cache_image() */ @@ -3203,26 +3225,31 @@ H5C__reconstruct_cache_contents(H5F_t *f, hid_t dxpl_id, H5C_t *cache_ptr) i = -1; entry_ptr = cache_ptr->LRU_head_ptr; + while(entry_ptr != NULL) { - HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); HDassert(entry_ptr->type != NULL); - if(entry_ptr->prefetched) { - HDassert(i <= entry_ptr->lru_rank); - HDassert((entry_ptr->lru_rank <= 2) || - (entry_ptr->lru_rank == i + 1) || - (entry_ptr->lru_rank == i + 2)); + if ( entry_ptr->prefetched ) { - if((entry_ptr->lru_rank <= 2) && (entry_ptr->lru_rank == i + 2)) - lru_rank_holes++; + HDassert(entry_ptr->lru_rank != 0); + HDassert((entry_ptr->lru_rank == -1) || + (entry_ptr->lru_rank > i)); - i = entry_ptr->lru_rank; - } /* end if */ + if ( ( entry_ptr->lru_rank > 1 ) && + ( entry_ptr->lru_rank > i + 1 ) ) + + lru_rank_holes += entry_ptr->lru_rank - (i + 1); + + i = entry_ptr->lru_rank; + + } /* end if */ - entry_ptr = entry_ptr->next; + entry_ptr = entry_ptr->next; } /* end while */ - /* Holes of size 1 appear in the LRU ranking due to epoch + /* Holes in the sequences of LRU ranks can appear due to epoch * markers. They are left in to allow re-insertion of the * epoch markers on reconstruction of the cache -- thus * the following sanity check will have to be revised when diff --git a/src/H5Cpkg.h b/src/H5Cpkg.h index 69e8145..90a84c4 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -686,6 +686,13 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ (cache_ptr)->images_created++; \ } +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) \ +{ \ + /* make sure image len is still good */ \ + HDassert((cache_ptr)->image_len > 0); \ + (cache_ptr)->images_read++; \ +} + #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) \ { \ /* make sure image len is still good */ \ @@ -931,6 +938,7 @@ if ( ( ( ( (head_ptr) == NULL ) || ( (tail_ptr) == NULL ) ) && \ #define H5C__UPDATE_STATS_FOR_LRU_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_INDEX_SCAN_RESTART(cache_ptr) #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_CREATE(cache_ptr) +#define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_READ(cache_ptr) #define H5C__UPDATE_STATS_FOR_CACHE_IMAGE_LOAD(cache_ptr) #define H5C__UPDATE_STATS_FOR_PREFETCH(cache_ptr, dirty) #define H5C__UPDATE_STATS_FOR_PREFETCH_HIT(cache_ptr) @@ -4549,6 +4557,18 @@ typedef struct H5C_tag_info_t { * Further, since cache images are only created at file * close, this field should only be set at that time. * + * images_read: Integer field containing the number of cache images + * read from file. Note that reading an image is different + * from loading it -- reading the image means just that, + * while loading the image refers to decoding it and loading + * it into the metadata cache. + * + * In the serial case, image_read should always equal + * images_loaded. However, in the parallel case, the + * image should only be read by process 0. All other + * processes should receive the cache image via a broadcast + * from process 0. + * * images_loaded: Integer field containing the number of cache images * loaded since the last time statistics were reset. * @@ -4864,6 +4884,7 @@ struct H5C_t { /* Fields for tracking cache image operations */ int32_t images_created; + int32_t images_read; int32_t images_loaded; hsize_t last_image_size; diff --git a/src/H5Ctag.c b/src/H5Ctag.c index a9bcca1..0170ce9 100644 --- a/src/H5Ctag.c +++ b/src/H5Ctag.c @@ -58,8 +58,18 @@ typedef struct { H5F_t * f; /* File pointer for evicting entry */ hid_t dxpl_id; /* DXPL for evicting entry */ - hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry was evicted when iterating over cache */ - hbool_t pinned_entries_need_evicted; /* Flag to indicate that a pinned entry was attempted to be evicted */ + hbool_t evicted_entries_last_pass; /* Flag to indicate that an entry + * was evicted when iterating over + * cache + */ + hbool_t pinned_entries_need_evicted;/* Flag to indicate that a pinned + * entry was attempted to be evicted + */ + hbool_t skipped_pf_dirty_entries; /* Flag indicating that one or more + * entries marked prefetched_dirty + * were encountered and not + * evicted. + */ } H5C_tag_iter_evict_ctx_t; /* Typedef for tagged entry iterator callback context - expunge tag type metadata */ @@ -470,7 +480,9 @@ H5C__evict_tagged_entries_cb(H5C_cache_entry_t *entry, void *_ctx) if(H5C__flush_single_entry(ctx->f, ctx->dxpl_id, entry, H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__DEL_FROM_SLIST_ON_DESTROY_FLAG) < 0) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, H5_ITER_ERROR, "Entry eviction failed.") ctx->evicted_entries_last_pass = TRUE; - } /* end else */ + } else { + ctx->skipped_pf_dirty_entries = TRUE; + } done: FUNC_LEAVE_NOAPI(ret_value) @@ -516,6 +528,7 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_gl /* Reset pinned/evicted tracking flags */ ctx.pinned_entries_need_evicted = FALSE; ctx.evicted_entries_last_pass = FALSE; + ctx.skipped_pf_dirty_entries = FALSE; /* Iterate through entries in the cache */ if(H5C__iter_tagged_entries(cache, tag, match_global, H5C__evict_tagged_entries_cb, &ctx) < 0) @@ -524,8 +537,32 @@ H5C_evict_tagged_entries(H5F_t * f, hid_t dxpl_id, haddr_t tag, hbool_t match_gl /* Keep doing this until we have stopped evicted entries */ } while(TRUE == ctx.evicted_entries_last_pass); - /* Fail if we have finished evicting entries and pinned entries still need evicted */ - if(ctx.pinned_entries_need_evicted) + /* In most cases, fail if we have finished evicting entries and pinned + * entries still need evicted + * + * However, things can get strange if the file was opened R/O and + * the file contains a cache image and the cache image contains dirty + * entries. + * + * Since the file was opened read only, dirty entries in the cache + * image were marked as clean when they were inserted into the metadata + * cache. This is necessary, as if they are marked dirty, the metadata + * cache will attempt to write them on file close, which is frowned + * upon when the file is opened R/O. + * + * On the other hand, such entries (marked prefetched_dirty) must not + * be evicted, as should the cache be asked to re-load them, the cache + * will attempt to read them from the file, and at best load an outdated + * version. + * + * To avoid this, H5C__evict_tagged_entries_cb has been modified to + * skip such entries. However, by doing so, it may prevent pinned + * entries from becoming unpinned. + * + * Thus we must ignore ctx.pinned_entries_need_evicted if + * ctx.skipped_pf_dirty_entries is TRUE. + */ + if((!ctx.skipped_pf_dirty_entries) && (ctx.pinned_entries_need_evicted)) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "Pinned entries still need evicted?!") done: diff --git a/test/cache_image.c b/test/cache_image.c index f49f7b3..dfbd02e 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -35,7 +35,7 @@ static void create_datasets(hid_t file_id, int min_dset, int max_dset); static void delete_datasets(hid_t file_id, int min_dset, int max_dset); static void open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_only, hbool_t set_mdci_fapl, hbool_t config_fsm, - const char *hdf_file_name, unsigned cache_image_flags, + hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, hid_t *file_id_ptr, H5F_t **file_ptr_ptr, H5C_t **cache_ptr_ptr); static void attempt_swmr_open_hdf5_file(hbool_t create_file, hbool_t set_mdci_fapl, const char *hdf_file_name); @@ -62,6 +62,7 @@ static unsigned cache_image_api_error_check_3(void); static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); +static unsigned evict_on_close_test(void); /****************************************************************************/ @@ -535,7 +536,7 @@ delete_datasets(hid_t file_id, int min_dset, int max_dset) static void open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, hbool_t read_only, hbool_t set_mdci_fapl, hbool_t config_fsm, - const char *hdf_file_name, unsigned cache_image_flags, + hbool_t set_eoc, const char *hdf_file_name, unsigned cache_image_flags, hid_t *file_id_ptr, H5F_t ** file_ptr_ptr, H5C_t ** cache_ptr_ptr) { const char * fcn_name = "open_hdf5_file()"; @@ -601,7 +602,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, /* call H5Pset_libver_bounds() on the fapl_id */ if ( pass ) { - if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0 ) { + if ( H5Pset_libver_bounds(fapl_id, H5F_LIBVER_LATEST, + H5F_LIBVER_LATEST) < 0 ) { pass = FALSE; failure_mssg = "H5Pset_libver_bounds() failed.\n"; @@ -667,7 +669,8 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, } if ( ( pass ) && ( config_fsm ) ) { - if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) { + if(H5Pset_file_space_strategy(fcpl_id, H5F_FSPACE_STRATEGY_PAGE, + TRUE, (hsize_t)1) < 0) { pass = FALSE; failure_mssg = "H5Pset_file_space_strategy() failed."; } @@ -675,6 +678,18 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); + /* set evict on close if indicated */ + if ( ( pass ) && ( set_eoc ) ) { + + if ( H5Pset_evict_on_close(fapl_id, TRUE) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Pset_evict_on_close() failed."; + } + } + + if ( show_progress ) HDfprintf(stdout, "%s: cp = %d.\n", fcn_name, cp++); + /* open the file */ if ( pass ) { @@ -682,10 +697,12 @@ open_hdf5_file(hbool_t create_file, hbool_t mdci_sbem_expected, if ( fcpl_id != -1 ) - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, fcpl_id, fapl_id); + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + fcpl_id, fapl_id); else - file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_id); + file_id = H5Fcreate(hdf_file_name, H5F_ACC_TRUNC, + H5P_DEFAULT, fapl_id); } else { @@ -1362,6 +1379,7 @@ check_cache_image_ctl_flow_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1415,6 +1433,7 @@ check_cache_image_ctl_flow_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1476,6 +1495,7 @@ check_cache_image_ctl_flow_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1637,6 +1657,7 @@ check_cache_image_ctl_flow_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1679,6 +1700,7 @@ check_cache_image_ctl_flow_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1718,6 +1740,7 @@ check_cache_image_ctl_flow_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1894,6 +1917,7 @@ check_cache_image_ctl_flow_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -1935,6 +1959,7 @@ check_cache_image_ctl_flow_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -1988,6 +2013,7 @@ check_cache_image_ctl_flow_3(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2041,6 +2067,7 @@ check_cache_image_ctl_flow_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2091,6 +2118,7 @@ check_cache_image_ctl_flow_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2260,6 +2288,7 @@ check_cache_image_ctl_flow_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2301,6 +2330,7 @@ check_cache_image_ctl_flow_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2343,6 +2373,7 @@ check_cache_image_ctl_flow_4(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2385,6 +2416,7 @@ check_cache_image_ctl_flow_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2424,6 +2456,7 @@ check_cache_image_ctl_flow_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2589,6 +2622,7 @@ check_cache_image_ctl_flow_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2648,6 +2682,7 @@ check_cache_image_ctl_flow_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2700,6 +2735,7 @@ check_cache_image_ctl_flow_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -2867,6 +2903,7 @@ check_cache_image_ctl_flow_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2915,6 +2952,7 @@ check_cache_image_ctl_flow_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__GEN_MDCI_SBE_MESG, /* file_id_ptr */ &file_id, @@ -2957,6 +2995,7 @@ check_cache_image_ctl_flow_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3149,6 +3188,7 @@ cache_image_smoke_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3215,6 +3255,7 @@ cache_image_smoke_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3280,6 +3321,7 @@ cache_image_smoke_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3346,6 +3388,7 @@ cache_image_smoke_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3388,6 +3431,7 @@ cache_image_smoke_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3567,6 +3611,7 @@ cache_image_smoke_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3630,6 +3675,7 @@ cache_image_smoke_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3675,6 +3721,7 @@ cache_image_smoke_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3865,6 +3912,7 @@ cache_image_smoke_check_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -3927,6 +3975,7 @@ cache_image_smoke_check_3(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -3992,6 +4041,7 @@ cache_image_smoke_check_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4055,6 +4105,7 @@ cache_image_smoke_check_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4248,6 +4299,7 @@ cache_image_smoke_check_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4312,6 +4364,7 @@ cache_image_smoke_check_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4379,6 +4432,7 @@ cache_image_smoke_check_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4442,6 +4496,7 @@ cache_image_smoke_check_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4493,7 +4548,6 @@ cache_image_smoke_check_4(void) if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 13) Delete the file */ @@ -4653,6 +4707,7 @@ cache_image_smoke_check_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4742,6 +4797,7 @@ cache_image_smoke_check_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -4842,6 +4898,7 @@ cache_image_smoke_check_5(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4893,6 +4950,7 @@ cache_image_smoke_check_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -4953,6 +5011,7 @@ cache_image_smoke_check_5(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5161,6 +5220,7 @@ cache_image_smoke_check_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5225,6 +5285,7 @@ cache_image_smoke_check_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5303,6 +5364,7 @@ cache_image_smoke_check_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5362,6 +5424,7 @@ cache_image_smoke_check_6(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5559,6 +5622,7 @@ cache_image_api_error_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5619,6 +5683,7 @@ cache_image_api_error_check_1(void) /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5681,6 +5746,7 @@ cache_image_api_error_check_1(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -5744,6 +5810,7 @@ cache_image_api_error_check_1(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5931,6 +5998,7 @@ cache_image_api_error_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -5991,6 +6059,7 @@ cache_image_api_error_check_2(void) /* read_only */ TRUE, /* set_mdci_fapl */ TRUE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6053,6 +6122,7 @@ cache_image_api_error_check_2(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ 0, /* file_id_ptr */ &file_id, @@ -6116,6 +6186,7 @@ cache_image_api_error_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6177,6 +6248,7 @@ cache_image_api_error_check_2(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6337,6 +6409,7 @@ cache_image_api_error_check_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6422,6 +6495,7 @@ cache_image_api_error_check_3(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6743,6 +6817,7 @@ cache_image_api_error_check_4(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -6997,6 +7072,7 @@ cache_image_api_error_check_4(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7209,6 +7285,7 @@ get_free_sections_test(void) /* read_only */ FALSE, /* set_mdci_fapl */ TRUE, /* config_fsm */ TRUE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7274,6 +7351,7 @@ get_free_sections_test(void) /* read_only */ TRUE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7398,6 +7476,7 @@ get_free_sections_test(void) /* read_only */ FALSE, /* set_mdci_fapl */ FALSE, /* config_fsm */ FALSE, + /* set_eoc */ FALSE, /* hdf_file_name */ filename, /* cache_image_flags */ H5C_CI__ALL_FLAGS, /* file_id_ptr */ &file_id, @@ -7566,6 +7645,379 @@ get_free_sections_test(void) /*------------------------------------------------------------------------- + * Function: evict_on_close_test() + * + * Purpose: If a file containing a cache image which in turn + * contains dirty entries is opened R/O, the metadata + * cache must refuse to evict the dirty entries, as + * it will not be able to reload them from file. This + * is a bit tricky, as the dirty entries must marked as + * clean in the metadata cache so that the MDC will not + * attempt to flush then on file close. + * + * The objective of this test is to verify that the + * metadata will not evict dirty entries in the above + * context when the file is opened with the evict on close + * FAPL entry. + * + * Do this by creating a HDF5 file with a cache image + * containing dirty metadata. + * + * Then close the file, re-open it R/O, and scan its + * contents twice. If evict on close succeeds in evicting + * the dirty metadata, the second scan will fail, as valid + * versions of the dirty metadata will not be available. + * + * To make the test more useful, enable persistant free + * space managers. + * + * The test is set up as follows: + * + * 1) Create a HDF5 file without a cache image requested + * and persistant free space managers enabled. + * + * 2) Create some data sets and verify them. + * + * 3) Close the file. + * + * 4) Open the file R/W, and with cache image requested. + * + * 5) Verify the datasets created in 2) above. This will + * force their (clean) metadata into the metadata cache, + * and hence into the cache image. + * + * 6) Create some more datasets. + * + * 7) Close the file. + * + * 8) Open the file R/O and with evict on close enabled. + * + * 9) Verify all datasets twice. + * + * 10) Close the file. + * + * 11) Open the file R/W and with evict on close enabled. + * + * 12) Verify all datasets twice. + * + * 13) Close the file. + * + * 14) Discard the file. + * + * Return: void + * + * Programmer: John Mainzer + * 3/23/17 + * + *------------------------------------------------------------------------- + */ +static unsigned +evict_on_close_test(void) +{ + const char * fcn_name = "evict_on_close_test()"; + char filename[512]; + hbool_t show_progress = FALSE; + hbool_t verbose = FALSE; + hid_t file_id = -1; + H5F_t *file_ptr = NULL; + H5C_t *cache_ptr = NULL; + int cp = 0; + + TESTING("Cache image / evict on close interaction"); + + pass = TRUE; + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* setup the file name */ + if ( pass ) { + + if ( h5_fixname(FILENAMES[0], H5P_DEFAULT, filename, sizeof(filename)) + == NULL ) { + + pass = FALSE; + failure_mssg = "h5_fixname() failed.\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 1) Create a HDF5 file without a cache image requested + * and persistant free space managers enabled. + */ + if ( pass ) { + + open_hdf5_file(/* create_file */ TRUE, + /* mdci_sbem_expected */ FALSE, + /* read_only */ FALSE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ TRUE, + /* set_eoc */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 2) Create some data sets and verify them. */ + + if ( pass ) { + + create_datasets(file_id, 1, 10); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + verify_datasets(file_id, 1, 10); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 3) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed (1).\n"; + + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 4) Open the file R/W, and with cache image requested. */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ FALSE, + /* read_only */ FALSE, + /* set_mdci_fapl */ TRUE, + /* config_fsm */ FALSE, + /* set_eoc */ FALSE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 5) Verify the datasets created in 2) above. This will + * force their (clean) metadata into the metadata cache, + * and hence into the cache image. + */ + + if ( pass ) { + + verify_datasets(file_id, 1, 10); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 6) Create some more datasets and verify them */ + + if ( pass ) { + + create_datasets(file_id, 11, 20); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + verify_datasets(file_id, 11, 20); + } + + if ( verbose ) { + + HDassert(cache_ptr); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + + HDfprintf(stdout, "index size / index dirty size = %lld / %lld\n", + (long long)(cache_ptr->index_size), + (long long)(cache_ptr->dirty_index_size)); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 7) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed (2).\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 8) Open the file R/O and with evict on close enabled. */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ TRUE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr); + } + + if ( show_progress ) + HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 9) Verify all datasets twice */ + + if ( pass ) { + + verify_datasets(file_id, 1, 20); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + verify_datasets(file_id, 1, 20); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 10) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed (3).\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 11) Open the file R/w and with evict on close enabled. */ + + if ( pass ) { + + open_hdf5_file(/* create_file */ FALSE, + /* mdci_sbem_expected */ TRUE, + /* read_only */ FALSE, + /* set_mdci_fapl */ FALSE, + /* config_fsm */ FALSE, + /* set_eoc */ TRUE, + /* hdf_file_name */ filename, + /* cache_image_flags */ H5C_CI__ALL_FLAGS, + /* file_id_ptr */ &file_id, + /* file_ptr_ptr */ &file_ptr, + /* cache_ptr_ptr */ &cache_ptr); + } + + if ( show_progress ) + HDfprintf(stdout, "%s*: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 12) Verify all datasets twice */ + + if ( pass ) { + + verify_datasets(file_id, 1, 20); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { + + verify_datasets(file_id, 1, 20); + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 13) Close the file. */ + + if ( pass ) { + + if ( H5Fclose(file_id) < 0 ) { + + pass = FALSE; + failure_mssg = "H5Fclose() failed (3).\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + + /* 14) Discard the file. */ + + if ( pass ) { + + if ( HDremove(filename) < 0 ) { + + pass = FALSE; + failure_mssg = "HDremove() failed.\n"; + } + } + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + if ( pass ) { PASSED(); } else { H5_FAILED(); } + + if ( ! pass ) + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", + FUNC, failure_mssg); + + return !pass; + +} /* evict_on_close_test() */ + + +/*------------------------------------------------------------------------- * Function: main * * Purpose: Run tests on the cache code contained in H5C.c @@ -7614,6 +8066,7 @@ main(void) nerrs += cache_image_api_error_check_4(); nerrs += get_free_sections_test(); + nerrs += evict_on_close_test(); return(nerrs > 0); diff --git a/test/page_buffer.c b/test/page_buffer.c index b94ad03..54a25d6 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -52,6 +52,10 @@ static unsigned test_raw_data_handling(hid_t orig_fapl, const char *env_h5_drvr) static unsigned test_lru_processing(hid_t orig_fapl, const char *env_h5_drvr); static unsigned test_min_threshold(hid_t orig_fapl, const char *env_h5_drvr); static unsigned test_stats_collection(hid_t orig_fapl, const char *env_h5_drvr); +#ifdef H5_HAVE_PARALLEL +static unsigned verify_page_buffering_disabled(hid_t orig_fapl, + const char *env_h5_drvr); +#endif /* H5_HAVE_PARALLEL */ const char *FILENAME[] = { "filepaged", @@ -2007,6 +2011,121 @@ error: /*------------------------------------------------------------------------- + * Function: verify_page_buffering_disabled() + * + * Purpose: This function should only be called in parallel + * builds. + * + * At present, page buffering should be disabled in parallel + * builds. Verify this. + * + * Return: 0 if test is sucessful + * 1 if test fails + * + * Programmer: John Mainzer + * 03/21/17 + * + * Changes: None. + * + *------------------------------------------------------------------------- + */ + +#ifdef H5_HAVE_PARALLEL +static unsigned +verify_page_buffering_disabled(hid_t orig_fapl, const char *env_h5_drvr) +{ + char filename[FILENAME_LEN]; /* Filename to use */ + hid_t file_id = -1; /* File ID */ + hid_t fcpl = -1; + hid_t fapl = -1; + + TESTING("Page Buffering Disabled"); + h5_fixname(FILENAME[0], orig_fapl, filename, sizeof(filename)); + + + /* first, try to create a file with page buffering enabled */ + + if((fapl = H5Pcopy(orig_fapl)) < 0) + TEST_ERROR + + if(set_multi_split(env_h5_drvr, fapl, 4096) != 0) + TEST_ERROR; + + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + FAIL_STACK_ERROR; + + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) + FAIL_STACK_ERROR; + + if(H5Pset_file_space_page_size(fcpl, 4096) < 0) + FAIL_STACK_ERROR; + + if(H5Pset_page_buffer_size(fapl, 4096*8, 0, 0) < 0) + FAIL_STACK_ERROR; + + /* try to create the file -- should fail */ + H5E_BEGIN_TRY { + file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl); + } H5E_END_TRY; + + if(file_id >= 0) + TEST_ERROR; + + /* now, create a file, close it, and then try to open it with page + * buffering enabled. + */ + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + FAIL_STACK_ERROR; + + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, 0, (hsize_t)1) < 0) + FAIL_STACK_ERROR; + + if(H5Pset_file_space_page_size(fcpl, 4096) < 0) + FAIL_STACK_ERROR; + + /* create the file */ + if((file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR; + + /* close the file */ + if(H5Fclose(file_id) < 0) + FAIL_STACK_ERROR; + + /* try to open the file using the fapl prepared above which enables + * page buffering. Should fail. + */ + H5E_BEGIN_TRY { + file_id = H5Fopen(filename, H5F_ACC_RDWR, fapl); + } H5E_END_TRY; + + if(file_id >= 0) + TEST_ERROR; + + if(H5Pclose(fcpl) < 0) + FAIL_STACK_ERROR; + + if(H5Pclose(fapl) < 0) + FAIL_STACK_ERROR; + + PASSED() + + return 0; + +error: + + H5E_BEGIN_TRY { + H5Pclose(fapl); + H5Pclose(fcpl); + H5Fclose(file_id); + } H5E_END_TRY; + + return 1; + +} /* verify_page_buffering_disabled() */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- * Function: main() * * Purpose: Main function for the page buffer tests. @@ -2026,8 +2145,6 @@ main(void) unsigned nerrors = 0; /* Cumulative error count */ const char *env_h5_drvr = NULL; /* File Driver value from environment */ -#ifndef H5_HAVE_PARALLEL - h5_reset(); /* Get the VFD to use */ @@ -2052,12 +2169,21 @@ main(void) PUTS_ERROR("Can't get VFD-dependent fapl") } /* end if */ +#ifdef H5_HAVE_PARALLEL + + HDputs("Page Buffering is disabled for parallel."); + nerrors += verify_page_buffering_disabled(fapl, env_h5_drvr); + +#else /* H5_HAVE_PARALLEL */ + nerrors += test_args(fapl, env_h5_drvr); nerrors += test_raw_data_handling(fapl, env_h5_drvr); nerrors += test_lru_processing(fapl, env_h5_drvr); nerrors += test_min_threshold(fapl, env_h5_drvr); nerrors += test_stats_collection(fapl, env_h5_drvr); +#endif /* H5_HAVE_PARALLEL */ + h5_clean_files(FILENAME, fapl); if(nerrors) @@ -2065,11 +2191,6 @@ main(void) HDputs("All Page Buffering tests passed."); -#else - SKIPPED() - HDputs("Page Buffering is disabled for parallel."); -#endif - HDexit(EXIT_SUCCESS); error: diff --git a/testpar/t_cache_image.c b/testpar/t_cache_image.c index a28af8e..f65b248 100644 --- a/testpar/t_cache_image.c +++ b/testpar/t_cache_image.c @@ -46,7 +46,9 @@ const char *FILENAMES[] = { /* local utility function declarations */ static void create_data_sets(hid_t file_id, int min_dset, int max_dset); +#if 0 /* keep pending full parallel cache image */ static void delete_data_sets(hid_t file_id, int min_dset, int max_dset); +#endif static void open_hdf5_file(const hbool_t create_file, const hbool_t mdci_sbem_expected, @@ -796,7 +798,12 @@ create_data_sets(hid_t file_id, int min_dset, int max_dset) * *------------------------------------------------------------------------- */ - +#if 0 +/* this code will be needed to test full support of cache image + * in parallel -- keep it around against that day. + * + * -- JRM + */ static void delete_data_sets(hid_t file_id, int min_dset, int max_dset) { @@ -843,6 +850,7 @@ delete_data_sets(hid_t file_id, int min_dset, int max_dset) return; } /* delete_data_sets() */ +#endif /*------------------------------------------------------------------------- @@ -2756,12 +2764,22 @@ usage(void) "The \"setup\" parameter indicates that t_cache_image is being \n", "invokde for this purpose.\n", "\n", - "usage: t_cache_image [setup]\n", + "Similarly, only a serial process can add a cache image to an\n", + "existing file.\n", + "\n", + "Here again, one process forks a serial version of the test program\n", + "with the \"ici\" parameter.\n" + "\n", + "usage: t_cache_image [setup|ici m n]\n", "\n", "where:\n", "\n", " setup parameter forces creation of test file\n", "\n", + " ici parameter forces insertion of a cache image into the \n", + " m th test file, created by a parallel computation with .\n", + " n processes\n", + "\n", "Returns 0 on success, 1 on failure.\n", "\n", NULL, @@ -3141,11 +3159,6 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) /* 1) Open the test file created at the beginning of this test. * * Verify that the file contains a cache image. - * - * Verify that only process 0 reads the cache image. - * - * Verify that all other processes receive the cache - * image block from process 0. */ if ( pass ) { @@ -3172,36 +3185,57 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that only process 0 reads the cache image. */ - - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that all other processes receive the cache image block - * from process 0. + /* 2) Verify that the file contains the expected data. + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. */ - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + if ( pass ) { + verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + } - /* 2) Verify that the file contains the expected data. */ + /* Verify that only process 0 reads the cache image. */ +#if H5C_COLLECT_CACHE_STATS if ( pass ) { - verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + if ( ( ( mpi_rank == 0 ) && ( cache_ptr->images_read != 1 ) ) || + ( ( mpi_rank > 0 ) && ( cache_ptr->images_read != 0 ) ) ) { + + pass = FALSE; + failure_mssg = "unexpected images_read."; + } } +#endif /* H5C_COLLECT_CACHE_STATS */ + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that all other processes receive the cache image block + * from process 0. + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on + * all processes. + */ #if H5C_COLLECT_CACHE_STATS if ( pass ) { - if ( cache_ptr->images_loaded == 0 ) { + if ( cache_ptr->images_loaded != 1 ) { pass = FALSE; - failure_mssg = "metadata cache image block not loaded(1)."; + failure_mssg = "Image not loaded?."; } } #endif /* H5C_COLLECT_CACHE_STATS */ + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* 3) Close the file. */ @@ -3317,12 +3351,13 @@ verify_cache_image_RO(int file_name_id, int md_write_strat, int mpi_rank) * * Verify that the file contains a cache image. * + * 2) Verify that the file contains the expected data. + * * Verify that only process 0 reads the cache image. * * Verify that all other processes receive the cache * image block from process 0. * - * 2) Verify that the file contains the expected data. * * 3) Close the file. * @@ -3434,36 +3469,56 @@ verify_cache_image_RW(int file_name_id, int md_write_strat, int mpi_rank) if ( show_progress ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* Verify that only process 0 reads the cache image. */ - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - - /* Verify that all other processes receive the cache image block - * from process 0. + /* 2) Verify that the file contains the expected data. + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. */ + if ( pass ) { - if ( show_progress ) - HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - + verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + } - /* 2) Verify that the file contains the expected data. */ + /* Verify that only process 0 reads the cache image. */ +#if H5C_COLLECT_CACHE_STATS if ( pass ) { - verify_data_sets(file_id, 0, MAX_NUM_DSETS - 1); + if ( ( ( mpi_rank == 0 ) && ( cache_ptr->images_read != 1 ) ) || + ( ( mpi_rank > 0 ) && ( cache_ptr->images_read != 0 ) ) ) { + + pass = FALSE; + failure_mssg = "unexpected images_read."; + } } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* Verify that all other processes receive the cache image block + * from process 0. + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on + * all processes. + */ #if H5C_COLLECT_CACHE_STATS if ( pass ) { - if ( cache_ptr->images_loaded == 0 ) { + if ( cache_ptr->images_loaded != 1 ) { pass = FALSE; - failure_mssg = "metadata cache image block not loaded(2)."; + failure_mssg = "Image not loaded?."; } } #endif /* H5C_COLLECT_CACHE_STATS */ + if ( show_progress ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* 3) Close the file. */ @@ -3754,7 +3809,13 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 7) Verify the datasets in the file backwards */ + /* 7) Verify the datasets in the file backwards + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. + */ i = num_dsets - 1; while ( ( pass ) && ( i >= 0 ) ) { @@ -3763,6 +3824,46 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) i--; } + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that only process 0 reads the cache image. */ +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( ( ( mpi_rank == 0 ) && ( cache_ptr->images_read != 1 ) ) || + ( ( mpi_rank > 0 ) && ( cache_ptr->images_read != 0 ) ) ) { + + pass = FALSE; + failure_mssg = "unexpected images_read."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that all other processes receive the cache image block + * from process 0. + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on + * all processes. + */ +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( cache_ptr->images_loaded != 1 ) { + + pass = FALSE; + failure_mssg = "Image not loaded?."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* 8) Close the file */ @@ -3776,6 +3877,9 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) } } + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* 9) Open the file */ @@ -3804,7 +3908,13 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); - /* 10) Verify the datasets in the file */ + /* 10) Verify the datasets in the file + * + * Verify that only process 0 reads the cache image. + * + * Verify that all other processes receive the cache + * image block from process 0. + */ i = 0; while ( ( pass ) && ( i < num_dsets ) ) { @@ -3816,6 +3926,43 @@ smoke_check_1(MPI_Comm mpi_comm, MPI_Info mpi_info, int mpi_rank, int mpi_size) if ( ( mpi_rank == 0 ) && ( show_progress ) ) HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* Verify that only process 0 reads the cache image. */ +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( ( ( mpi_rank == 0 ) && ( cache_ptr->images_read != 1 ) ) || + ( ( mpi_rank > 0 ) && ( cache_ptr->images_read != 0 ) ) ) { + + pass = FALSE; + failure_mssg = "unexpected images_read."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + + /* Verify that all other processes receive the cache image block + * from process 0. + * + * Since we have alread verified that only process 0 has read the + * image, it is sufficient to verify that the image was loaded on + * all processes. + */ +#if H5C_COLLECT_CACHE_STATS + if ( pass ) { + + if ( cache_ptr->images_loaded != 1 ) { + + pass = FALSE; + failure_mssg = "Image not loaded?."; + } + } +#endif /* H5C_COLLECT_CACHE_STATS */ + + if ( ( mpi_rank == 0 ) && ( show_progress ) ) + HDfprintf(stdout, "%s: cp = %d, pass = %d.\n", fcn_name, cp++, pass); + /* 11) Delete the datasets in the file */ -- cgit v0.12 From ef297238bd51d4a7fa530172a547952207c4902d Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 29 Mar 2017 13:36:52 -0500 Subject: Add LBNL license file and modify COPYING file accordingly. --- COPYING | 15 +++++++++++---- COPYING_LBNL_HDF5 | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 COPYING_LBNL_HDF5 diff --git a/COPYING b/COPYING index 2166ced..51cb4e6 100644 --- a/COPYING +++ b/COPYING @@ -1,13 +1,12 @@ - Copyright Notice and License Terms for HDF5 (Hierarchical Data Format 5) Software Library and Utilities ----------------------------------------------------------------------------- HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 2006-2016 by The HDF Group. +Copyright (c) 2006, The HDF Group. NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities -Copyright 1998-2006 by the Board of Trustees of the University of Illinois. +Copyright (c) 1998-2006, The Board of Trustees of the University of Illinois. All rights reserved. @@ -47,13 +46,21 @@ advised of the possibility of such damage. ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- +Limited portions of HDF5 were developed by Lawrence Berkeley National +Laboratory (LBNL). LBNL's Copyright Notice and Licensing Terms can be +found here: COPYING_LBNL_HDF5 file in this directory or at +http://support.hdfgroup.org/ftp/HDF5/releases/COPYING_LBNL_HDF5. + +----------------------------------------------------------------------------- +----------------------------------------------------------------------------- + Contributors: National Center for Supercomputing Applications (NCSA) at the University of Illinois, Fortner Software, Unidata Program Center (netCDF), The Independent JPEG Group (JPEG), Jean-loup Gailly and Mark Adler (gzip), and Digital Equipment Corporation (DEC). ----------------------------------------------------------------------------- - + Portions of HDF5 were developed with support from the Lawrence Berkeley National Laboratory (LBNL) and the United States Department of Energy under Prime Contract No. DE-AC02-05CH11231. diff --git a/COPYING_LBNL_HDF5 b/COPYING_LBNL_HDF5 new file mode 100644 index 0000000..16fba5d --- /dev/null +++ b/COPYING_LBNL_HDF5 @@ -0,0 +1,49 @@ +Copyright Notice and License Terms for +HDF5 (Hierarchical Data Format 5) Software Library and Utilities +----------------------------------------------------------------------------- + +HDF5 (Hierarchical Data Format 5) +Copyright (c) 2016, The Regents of the University of California, through +Lawrence Berkeley National Laboratory (subject to receipt of any required +approvals from the U.S. Dept. of Energy). + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, + this list of conditions, and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions, and the following disclaimer in the documentation + and/or materials provided with the distribution. + +3. Neither the name of the University of California, Lawrence Berkeley +National Laboratory, U.S. Dept. of Energy nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. + +You are under no obligation whatsoever to provide any bug fixes, patches, +or upgrades to the features, functionality or performance of the source +code ("Enhancements") to anyone; however, if you choose to make your +Enhancements available either publicly, or directly to Lawrence Berkeley +National Laboratory, without imposing a separate written license agreement +for such Enhancements, then you hereby grant the following license: +a non-exclusive, royalty-free perpetual license to install, use, modify, +prepare derivative works, incorporate into other computer software, +distribute, and sublicense such enhancements or derivative works thereof, +in binary and source code form. + -- cgit v0.12 From c1f95b28caae290a7c0136537daca9004db055b8 Mon Sep 17 00:00:00 2001 From: lrknox Date: Wed, 29 Mar 2017 13:55:41 -0500 Subject: Revert "Clear hdf5 1.10 entries from RELEASE.txt in the develop branch. Entries" This reverts commit 1a114c191d6366558202522df96c2726c0512cc0. --- release_docs/RELEASE.txt | 359 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 332 insertions(+), 27 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d2e73e0..22accd3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -4,8 +4,8 @@ HDF5 version 1.11.0 currently under development INTRODUCTION -This document describes the differences between HDF5-1.11.x and -HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.11.x. +This document describes the differences between HDF5-1.10.0-patch1 and +HDF5 1.10.1, and contains information on the platforms tested and known problems in HDF5-1.10.1. For more details check the HISTORY*.txt files in the HDF5 source. @@ -28,8 +28,8 @@ in 1.10.1?" document: https://support.hdfgroup.org/HDF5/doc/ADGuide/WhatsNew1101.html All new and modified APIs are listed in detail in the "HDF5 Software Changes -from Release to Release" document, in the section "Release 1.10.1 (current -release) versus Release 1.11.x +from Release to Release" document, in the section "Release 1.8.19 (current +release) versus Release 1.10.1 https://support.hdfgroup.org/HDF5/doc1.10/ADGuide/Changes.html @@ -42,7 +42,7 @@ CONTENTS - New Features - Support for new platforms and languages -- Bug Fixes since HDF5-1.10.1 +- Bug Fixes since HDF5-1.10.0-patch1 - Supported Platforms - Tested Configuration Features Summary - More Tested Platforms @@ -54,11 +54,33 @@ New Features Configuration: ------------- - - + - CMake minimum is now 3.2.2. + (ADB 2017/01/10) + + - Tools folder is separated into source and test folders. This + allows autotools to skip the make command and just execute + the make check command. + (HDFFV-9719 ADB 2016/10/27) Library: -------- - - + - Paged Aggregation + + This is one of the file space management strategies. This strategy + aggregates small metadata and raw data allocations into constant-sized + well-aligned pages, which are suitable for page caching. Paged + aggregation together with the page buffering feature will allow efficient + I/O accesses. + + - Page Buffering + + The page buffering layer in the HDF5 library absorbs small accesses to + the file system. Each page in memory corresponds to a page allocated in + the file. Access to the file system is then performed as a single page + or multiple of pages, if they are contiguous. This ensures that small + accesses to the file system are avoided while providing another caching + layer for improved I/O performance. This feature works in conjunction + with the paged aggregation feature. Parallel Library: ----------------- @@ -74,11 +96,13 @@ New Features Tools: ------ - - + - Add options to h5clear: + -s: clear the status_flags field in the file's superblock + -m: Remove the metadata cache image from the file + (Pull Request #361 QK 2017/03/22) High-Level APIs: --------------- - - C Packet Table API ------------------ @@ -95,16 +119,44 @@ Support for new platforms, languages and compilers. ======================================= - -Bug Fixes since HDF5-1.10.1 release +Bug Fixes since HDF5-1.10.0-patch1 release ================================== Library ------- - - + - Changed the plugins dlopen option from RTLD_NOW to RTLD_LAZY + (PR 201 ADB 2016/12/12) + + - Fix error when copying dataset with attribute which is a compound datatype + consisting of a variable length string. + (HDFFV-7991 VC 2016/08/19, 2016/08/21, 2016/08/24) + + - H5DOappend will not fail if a dataset has no append callback registered. + (HDFFV-9960 VC 2016/08/05, 2016/08/14) + + - Fix the problem where the committed datatype's file location is different + from the file location of an attribute with that committed datatype. + (HDFFV-9940 VC 2016/07/03, 2016/07/06) + + - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. + (b) Modifications to better handle error recovery when conversion by + h5format_convert fails. + (HDFFV-9434 VC 2016/05/29) Configuration ------------- - - + - Configuration will check for the strtoll and strtoull functions + before using alternatives + (PR 340 ADB 2017/03/17) + + - CMake uses a Windows pdb directory variable if available and + will generate both static and shared pdb files. + (HDFFV-9875 ADB 2017/02/06) + + - CMake now builds shared versions of tools. + (HDFFV-10123 ADB 2017/02/01) + + Performance ------------- - @@ -114,7 +166,11 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- - - + - h5diff correctly ignores strpad in comparing strings. + (HDFFV-10128 ADB 2017/03/03) + + - h5repack now correctly parses the command line filter options. + (HDFFV-10046 ADB 2017/01/24) High-Level APIs: ------ @@ -145,6 +201,18 @@ Bug Fixes since HDF5-1.10.1 release Supported Platforms =================== + Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) + #1 SMP x86_64 GNU/Linux compilers: + (mayll/platypus) Version 4.4.7 20120313 + Version 4.8.4 + PGI C, Fortran, C++ for 64-bit target on + x86-64; + Version 16.10-0 + Intel(R) C (icc), C++ (icpc), Fortran (icc) + compilers: + Version 15.0.3.187 (Build 20150407) + MPICH 3.1.4 compiled with GCC 4.9.3 + Linux 2.6.32-573.18.1.el6.ppc64 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) #1 SMP ppc64 GNU/Linux g++ (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) (ostrich) GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4) @@ -223,7 +291,9 @@ Mac OS X Mountain Lion 10.8.5 64-bit n y/y n y y y Mac OS X Mavericks 10.9.5 64-bit n y/y n y y ? Mac OS X Yosemite 10.10.5 64-bit n y/y n y y ? Mac OS X El Capitan 10.11.6 64-bit n y/y n y y ? -CentOS 7.2 Linux 2.6.32 x86_64 PGI n y/y n y y y +CentOS 6.7 Linux 2.6.18 x86_64 GNU n y/y n y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel n y/y n y y y +CentOS 6.7 Linux 2.6.32 x86_64 PGI n y/y n y y y CentOS 7.2 Linux 2.6.32 x86_64 GNU y y/y y y y y CentOS 7.2 Linux 2.6.32 x86_64 Intel n y/y n y y y Linux 2.6.32-573.18.1.el6.ppc64 n y/n n y y y @@ -243,7 +313,9 @@ Mac OS X Mountain Lion 10.8.5 64-bit y n y y Mac OS X Mavericks 10.9.5 64-bit y n y y Mac OS X Yosemite 10.10.5 64-bit y n y y Mac OS X El Capitan 10.11.6 64-bit y n y y -CentOS 7.2 Linux 2.6.32 x86_64 PGI y y y n +CentOS 6.7 Linux 2.6.18 x86_64 GNU y y y y +CentOS 6.7 Linux 2.6.18 x86_64 Intel y y y n +CentOS 6.7 Linux 2.6.32 x86_64 PGI y y y n CentOS 7.2 Linux 2.6.32 x86_64 GNU y y y n CentOS 7.2 Linux 2.6.32 x86_64 Intel y y y n Linux 2.6.32-573.18.1.el6.ppc64 y y y n @@ -256,18 +328,6 @@ More Tested Platforms ===================== The following platforms are not supported but have been tested for this release. - Linux 2.6.32-573.22.1.el6 GNU C (gcc), Fortran (gfortran), C++ (g++) - #1 SMP x86_64 GNU/Linux compilers: - (mayll/platypus) Version 4.4.7 20120313 - Version 4.8.4 - PGI C, Fortran, C++ for 64-bit target on - x86-64; - Version 16.10-0 - Intel(R) C (icc), C++ (icpc), Fortran (icc) - compilers: - Version 15.0.3.187 (Build 20150407) - MPICH 3.1.4 compiled with GCC 4.9.3 - Linux 2.6.32-573.18.1.el6.ppc64 MPICH mpich 3.1.4 compiled with #1 SMP ppc64 GNU/Linux IBM XL C/C++ for Linux, V13.1 (ostrich) and IBM XL Fortran for Linux, V15.1 @@ -290,4 +350,249 @@ The following platforms are not supported but have been tested for this release. Known Problems ============== +* "make check" fails on CYGWIN when building shared lib files is enabled. The + default on Cygwin has been changed to disable shared. It can be enabled with + the --enable-shared configure option but is likely to fail "make check" + with GCC compilers. (LK -2015/04/16) + +* CLANG compiler with the options -fcatch-undefined-behavior and -ftrapv + catches some undefined behavior in the alignment algorithm of the macro DETECT_I + in H5detect.c (Issue 8147). Since the algorithm is trying to detect the alignment + of integers, ideally the flag -fcatch-undefined-behavior shouldn't to be used for + H5detect.c. In the future, we can separate flags for H5detect.c from the rest of + the library. (SLU - 2013/10/16) + +* The 5.9 C++ compiler on Sun failed to compile a C++ test ttypes.cpp. It + complains with this message: + "/home/hdf5/src/H5Vprivate.h", line 130: Error: __func__ is not defined. + + The reason is that __func__ is a predefined identifier in C99 standard. The + HDF5 C library uses it in H5private.h. The test ttypes.cpp includes + H5private.h (H5Tpkg.h<-H5Fprivate.h<-H5Vprivate.h<-H5private.h). Sun's 5.9 + C++ compiler doesn't support __func__, thus fails to compile the C++ test. + But 5.11 C++ compiler does. To check whether your Sun C++ compiler knows this + identifier, try to compile the following simple C++ program: + #include + + int main(void) + { + printf("%s\n", __func__); + return 0; + } + (SLU - 2012/11/5) + +* The C++ and FORTRAN bindings are not currently working on FreeBSD with the + native release 8.2 compilers (4.2.1), but are working with gcc 4.6 from the + ports (and probably gcc releases after that). + (QAK - 2012/10/19) + +* 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 + (3.2.2 on Fedora) doesn't have the problem. Users should lower down the + optimization level (-O1 or -O0) by defining CFLAGS in the command line of + "configure" like: + + CFLAGS=-O1 ./configure + + It will overwrite the library's default optimization level. (Issue 7829. + SLU - 2012/2/7) + +* --with-mpe configure option does not work with Mpich2. AKC - 2011/03/10) + +* While working on the 1.8.6 release of HDF5, a bug was discovered that can + occur when reading from a dataset in parallel shortly after it has been + written to collectively. The issue was exposed by a new test in the parallel + HDF5 test suite, but had existed before that. We believe the problem lies with + certain MPI implementations and/or filesystems. + + We have provided a pure MPI test program, as well as a standalone HDF5 + program, that can be used to determine if this is an issue on your system. + They should be run across multiple nodes with a varying number of processes. + These programs can be found at: + http://www.hdfgroup.org/ftp/HDF5/examples/known_problems/ + +* Parallel mode in AIX will fail some of the testcheck_version.sh tests where + it treats "exit(134) the same as if process 0 had received an abort signal. + This is fixed and will be available in the next release. AKC - 2009/11/3 + +* The PathScale MPI implementation, accessing a Panasas file system, would + cause H5Fcreate() with H5F_ACC_EXCL to fail even when the file is not + existing. This is due to the MPI_File_open() call failing if the amode has + the MPI_MODE_EXCL bit set. (See bug 1468 for details.) AKC - 2009/8/11 + +* Parallel tests failed with 16 processes with data inconsistency at testphdf5 + / dataset_readAll. Parallel tests also failed with 32 and 64 processes with + collective abort of all ranks at t_posix_compliant / allwrite_allread_blocks + with MPI IO. (CMC - 2009/04/28) + +* For SNL, spirit/liberty/thunderbird: The serial tests pass but parallel + tests failed with MPI-IO file locking message. AKC - 2007/6/25. +* On Intel 64 Linux cluster (RH 4, Linux 2.6.9) with Intel 10.0 compilers use + -mp -O1 compilation flags to build the libraries. Higher level of optimization + causes failures in several HDF5 library tests. +* For HPUX 11.23 many tools tests failed for 64-bit version when linked to the + shared libraries (tested for 1.8.0-beta2) +* For SNL, Red Storm: only paralle HDF5 is supported. The serial tests pass + and the parallel tests also pass with lots of non-fatal error messages. +* on SUN 5.10 C++ test fails in the "Testing Shared Datatypes with Attributes" test +* configuring with --enable-debug=all produces compiler errors on most + platforms. Users who want to run HDF5 in debug mode should use + --enable-debug rather than --enable-debug=all to enable debugging + information on most modules. +* On Mac OS 10.4, test/dt_arith.c has some errors in conversion from long + double to (unsigned) long long and from (unsigned)long long to long double. +* On Altix SGI with Intel 9.0 testmeta.c would not compile with -O3 + optimization flag. +* On VAX, Scaleoffset filter isn't supported. The filter cannot be applied to + HDF5 data generated on VAX. Scaleoffset filter only supports IEEE standard + for floating-point data. +* On Cray X1, a lone colon on the command line of h5dump --xml (as in + the testh5dumpxml.sh script) is misinterpereted by the operating system + and causes an error. +* On mpich 1.2.5 and 1.2.6, we found that if more than two processes + contribute no IO and the application asks to do IO with collective, we found + that when using 4 processors, a simple collective write will be hung + sometimes. This can be verified with t_mpi test under testpar. +* The dataset created or rewritten with the v1.6.3 library or after can't + be read with the v1.6.2 library or before when Fletcher32 EDC(filter) is + enabled. There was a bug in the calculating code of the Fletcher32 + checksum in the library before v1.6.3. The checksum value wasn't consistent + between big-endian and little-endian systems. This bug was fixed in + Release 1.6.3. However, after fixing the bug, the checksum value is no + longer the same as before on little-endian system. The library release + after 1.6.4 can still read the dataset created or rewritten with the library + of v1.6.2 or before. SLU - 2005/6/30 +* For the version 6(6.02 and 6.04) of Portland Group compiler on AMD Opteron + processor, there's a bug in the compiler for optimization(-O2). The library + failed in several tests but all related to multi driver. The problem has + been reported to the vendor. +* On IBM AIX systems, parallel HDF5 mode will fail some tests with error + messages like "INFO: 0031-XXX ...". This is from the command poe. + Set the environment variable MP_INFOLEVEL to 0 to minimize the messages + and run the tests again. + The tests may fail with messages like "The socket name is already + in use". HDF5 does not use sockets (except for stream-VFD). This is + due to problems of the poe command trying to set up the debug socket. + Check if there are many old /tmp/s.pedb.* staying around. These are + sockets used by the poe command and left behind due to failed commands. + Ask your system administrator to clean them out. Lastly, request IBM + to provide a mean to run poe without the debug socket. + +* The C++ library's tests fails when compiling with PGI C++ compiler. The + workaround until the problem is correctly handled is to use the + flag "--instantiate=local" prior to the configure and build steps, as: + setenv CXX "pgCC --instantiate=local" for pgCC 5.02 and higher + + +* The stream-vfd test uses ip port 10007 for testing. If another + application is already using that port address, the test will hang + indefinitely and has to be terminated by the kill command. To try the + test again, change the port address in test/stream_test.c to one not + being used in the host. + +* The --enable-static-exec configure flag will only statically link libraries + if the static version of that library is present. If only the shared version + of a library exists (i.e., most system libraries on Solaris, AIX, and Mac, + for example, only have shared versions), the flag should still result in a + successful compilation, but note that the installed executables will not be + fully static. Thus, the only guarantee on these systems is that the + executable is statically linked with just the HDF5 library. + +* With the gcc 2.95.2 compiler, HDF 5 uses the `-ansi' flag during + compilation. The ANSI version of the compiler complains about not being + able to handle the `long long' datatype with the warning: + + warning: ANSI C does not support `long long' + + This warning is innocuous and can be safely ignored. + +* Certain platforms give false negatives when testing h5ls: + - Cray J90 and Cray T90IEEE give errors during testing when displaying + some floating-point values. These are benign differences due to + the different precision in the values displayed and h5ls appears to + be dumping floating-point numbers correctly. + +* Not all platforms behave correctly with szip's shared libraries. Szip is + disabled in these cases, and a message is relayed at configure time. Static + libraries should be working on all systems that support szip, and should be + used when shared libraries are unavailable. There is also a configure error + on Altix machines that incorrectly reports when a version of szip without + an encoder is being used. + +* On some platforms that use Intel and Absoft compilers to build HDF5 fortran library, + compilation may fail for fortranlib_test.f90, fflush1.f90 and fflush2.f90 + complaining about exit subroutine. Comment out the line + IF (total_error .ne. 0) CALL exit (total_error) + +* Information about building with PGI and Intel compilers is available in + INSTALL file sections 5.7 and 5.8 + +* On at least one system, (SDSC DataStar), the scheduler (in this case + LoadLeveler) sends job status updates to standard error when you run + any executable that was compiled with the parallel compilers. + + This causes problems when running "make check" on parallel builds, as + many of the tool tests function by saving the output from test runs, + and comparing it to an exemplar. + + The best solution is to reconfigure the target system so it no longer + inserts the extra text. However, this may not be practical. + + In such cases, one solution is to "setenv HDF5_Make_Ignore yes" prior to + the configure and build. This will cause "make check" to continue after + detecting errors in the tool tests. However, in the case of SDSC DataStar, + it also leaves you with some 150 "failed" tests to examine by hand. + + A second solution is to write a script to run serial tests and filter + out the text added by the scheduler. A sample script used on SDSC + DataStar is given below, but you will probably have to customize it + for your installation. + + Observe that the basic idea is to insert the script as the first item + on the command line which executes the the test. The script then + executes the test and filters out the offending text before passing + it on. + + #!/bin/csh + + set STDOUT_FILE=~/bin/serial_filter.stdout + set STDERR_FILE=~/bin/serial_filter.stderr + + rm -f $STDOUT_FILE $STDERR_FILE + + ($* > $STDOUT_FILE) >& $STDERR_FILE + + set RETURN_VALUE=$status + + cat $STDOUT_FILE + + tail +3 $STDERR_FILE + + exit $RETURN_VALUE + + You get the HDF make files and test scipts to execute your filter script + by setting the environment variable "RUNSERIAL" to the full path of the + script prior to running configure for parallel builds. Remember to + "unsetenv RUNSERIAL" before running configure for a serial build. + + Note that the RUNSERIAL environment variable exists so that we can + can prefix serial runs as necessary on the target system. On DataStar, + no prefix is necessary. However on an MPICH system, the prefix might + have to be set to something like "/usr/local/mpi/bin/mpirun -np 1" to + get the serial tests to run at all. + + In such cases, you will have to include the regular prefix in your + filter script. + +* H5Ocopy() does not copy reg_ref attributes correctly when shared-message + is turn on. The value of the reference in the destination attriubte is + wrong. This H5Ocopy problem will affect h5copy tool -- cgit v0.12 From 8eef625ef49ac53c6e3c6d41ca8ec3a620db981b Mon Sep 17 00:00:00 2001 From: lrknox Date: Thu, 30 Mar 2017 10:33:51 -0500 Subject: Add new file COPYING_LBNL_HDF5. --- MANIFEST | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST b/MANIFEST index 3d252eb..a19c850 100644 --- a/MANIFEST +++ b/MANIFEST @@ -26,6 +26,7 @@ ./.h5chkright.ini _DO_NOT_DISTRIBUTE_ ./ACKNOWLEDGMENTS ./COPYING +./COPYING_LBNL_HDF5 ./MANIFEST ./Makefile.dist ./Makefile.am -- cgit v0.12 From 1dee0d46273882eedeed50238d9e3e23cf435291 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:15:25 -0500 Subject: HDFFV-10143 Fix initial issues from review --- MANIFEST | 1 + src/CMakeLists.txt | 1 + src/H5PL.c | 137 +++++++++++++---------------------------------- src/H5PLpkg.h | 50 ++++++++++++++++++ test/plugin.c | 152 ++++++++++++++++++++++++++++++++--------------------- 5 files changed, 181 insertions(+), 160 deletions(-) create mode 100644 src/H5PLpkg.h diff --git a/MANIFEST b/MANIFEST index 3d252eb..9400fe3 100644 --- a/MANIFEST +++ b/MANIFEST @@ -800,6 +800,7 @@ ./src/H5PBprivate.h ./src/H5PL.c ./src/H5PLmodule.h +./src/H5PLpkg.h ./src/H5PLprivate.h ./src/H5PLpublic.h ./src/H5PLextern.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9321bbd..e2acd30 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -520,6 +520,7 @@ set (H5PL_SOURCES set (H5PL_HDRS ${HDF5_SRC_DIR}/H5PLextern.h + ${HDF5_SRC_DIR}/H5PLpkg.h ${HDF5_SRC_DIR}/H5PLpublic.h ) IDE_GENERATED_PROPERTIES ("H5PL" "${H5PL_HDRS}" "${H5PL_SOURCES}" ) diff --git a/src/H5PL.c b/src/H5PL.c index 898e84b..f6af691 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -25,15 +25,34 @@ #include "H5private.h" /* Generic Functions */ #include "H5Eprivate.h" /* Error handling */ #include "H5MMprivate.h" /* Memory management */ -#include "H5PLprivate.h" /* Plugin */ +#include "H5PLpkg.h" /* Plugin */ #include "H5Zprivate.h" /* Filter pipeline */ /****************/ /* Local Macros */ /****************/ - -#define H5PL_MAX_PATH_NUM 16 +#ifdef H5_HAVE_WIN32_API +#define H5PL_EXPAND_ENV_VAR { \ + long bufCharCount; \ + char *tempbuf; \ + if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \ + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \ + if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \ + } \ + if(bufCharCount == 0) { \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \ + } \ + dl_path = (char *)H5MM_xfree(dl_path); \ + dl_path = H5MM_strdup(tempbuf); \ + tempbuf = (char *)H5MM_xfree(tempbuf); \ + } +#else +#define H5PL_EXPAND_ENV_VAR +#endif /* H5_HAVE_WIN32_API */ /****************************/ /* Macros for supporting @@ -412,25 +431,9 @@ H5PLappend(char* plugin_path) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dl_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_num_paths_g++; @@ -467,25 +470,9 @@ H5PLprepend(char* plugin_path) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if (NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if ((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if (bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; if (NULL == (H5PL_path_table_g[0] = H5MM_strdup(dl_path))) @@ -521,25 +508,9 @@ H5PLput(char* plugin_path, unsigned int index) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) @@ -577,25 +548,9 @@ H5PLinsert(char* plugin_path, unsigned int index) dl_path = H5MM_strdup(plugin_path); if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + + H5PL_EXPAND_ENV_VAR + for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) @@ -662,9 +617,9 @@ H5PLget(unsigned int index) FUNC_ENTER_API(NULL) if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, NULL, "no directories in table") if(NULL == (ret_value = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no directory path at index") done: FUNC_LEAVE_API(ret_value) @@ -720,25 +675,7 @@ H5PL__init_path_table(void) if(NULL == dl_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") -#ifdef H5_HAVE_WIN32_API - else { /* Expand windows env var*/ - long bufCharCount; - char *tempbuf; - if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") - } - if(bufCharCount == 0) { - tempbuf = (char *)H5MM_xfree(tempbuf); - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") - } - dl_path = (char *)H5MM_xfree(dl_path); - dl_path = H5MM_strdup(tempbuf); - tempbuf = (char *)H5MM_xfree(tempbuf); - } -#endif /* H5_HAVE_WIN32_API */ + H5PL_EXPAND_ENV_VAR /* Put paths in the path table. They are separated by ":" */ dir = HDstrtok(dl_path, H5PL_PATH_SEPARATOR); diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h new file mode 100644 index 0000000..2761a33 --- /dev/null +++ b/src/H5PLpkg.h @@ -0,0 +1,50 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * 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. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#if !(defined H5PL_FRIEND || defined H5PL_MODULE) +#error "Do not include this file outside the H5PL package!" +#endif + +#ifndef _H5PLpkg_H +#define _H5PLpkg_H + +/* Include private header file */ +#include "H5PLprivate.h" /* Filter functions */ + +/* Other private headers needed by this file */ + +/**************************/ +/* Package Private Macros */ +/**************************/ + + +/****************************/ +/* Package Private Typedefs */ +/****************************/ + +#define H5PL_MAX_PATH_NUM 16 + + +/*****************************/ +/* Package Private Variables */ +/*****************************/ + + +/******************************/ +/* Package Private Prototypes */ +/******************************/ + +#endif /* _H5PLpkg_H */ + diff --git a/test/plugin.c b/test/plugin.c index 1d55a5d..c739b72 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -22,8 +22,10 @@ #include "H5srcdir.h" /* - * This file needs to access private datatypes from the H5Z package. + * This file needs to access private datatypes from the H5Z and H5PL package. */ +#define H5PL_FRIEND +#include "H5PLpkg.h" #define H5Z_FRIEND #include "H5Zpkg.h" @@ -114,7 +116,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); - printf(" Line %d: Incorrect filter availability\n",__LINE__); + HDprintf(" Line %d: Incorrect filter availability\n",__LINE__); TEST_ERROR } /* end if */ @@ -137,8 +139,8 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j<(size_t)size[1]; j++) { if(0!=check[i][j]) { H5_FAILED(); - printf(" Read a non-zero value.\n"); - printf(" At index %lu,%lu\n", + HDprintf(" Read a non-zero value.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); TEST_ERROR } @@ -180,10 +182,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) for(j=0; j 0; i--) { if (H5PLremove(i-1) < 0) { - fprintf(stderr," at %d: %s\n", i, pathname); + HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } @@ -772,9 +774,9 @@ test_filter_path_apis(void) TESTING(" append"); /* Create multiple paths to fill table */ for (i=0; i < 16; i++) { - sprintf(pathname, "a_path_%d", i); + HDsprintf(pathname, "a_path_%d", i); if (H5PLappend(pathname) < 0) { - fprintf(stderr," at %d: %s\n", i, pathname); + HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } @@ -785,11 +787,41 @@ test_filter_path_apis(void) TESTING(" append (exceed)"); /* Exceed the max path append */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 16); + HDsprintf(pathname, "a_path_%d", 16); ret = H5PLappend(pathname); } H5E_END_TRY if (ret >= 0) TEST_ERROR + + /* Exceed the max path removal */ + H5E_BEGIN_TRY { + ret = H5PLremove(16); + } H5E_END_TRY + if (ret >= 0) + TEST_ERROR + PASSED(); + + TESTING(" get (bounds)"); + HDsprintf(pathname, "%s", H5PLget(0)); + if (strcmp(pathname, "a_path_0") != 0) { + HDfprintf(stderr," get 0: %s\n", pathname); + TEST_ERROR + } + HDsprintf(pathname, "%s", H5PLget(1)); + if (strcmp(pathname, "a_path_1") != 0) { + HDfprintf(stderr," get 1: %s\n", pathname); + TEST_ERROR + } + HDsprintf(pathname, "%s", H5PLget(15)); + if (strcmp(pathname, "a_path_15") != 0) { + HDfprintf(stderr," get 15: %s\n", pathname); + TEST_ERROR + } + PASSED(); + + TESTING(" get (bounds exceed)"); + if (H5PLget(16) != NULL) + TEST_ERROR PASSED(); TESTING(" remove (verify for prepend)"); @@ -797,9 +829,9 @@ test_filter_path_apis(void) if (H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(8)); + HDsprintf(pathname, "%s", H5PLget(8)); if (strcmp(pathname, "a_path_9") != 0) { - fprintf(stderr," get 8: %s\n", pathname); + HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } PASSED(); @@ -809,9 +841,9 @@ test_filter_path_apis(void) TESTING(" prepend"); /* Prepend one path*/ - sprintf(pathname, "a_path_%d", 17); + HDsprintf(pathname, "a_path_%d", 17); if (H5PLprepend(pathname) < 0) { - fprintf(stderr," prepend 17: %s\n", pathname); + HDfprintf(stderr," prepend 17: %s\n", pathname); TEST_ERROR } @@ -819,14 +851,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(8)); + HDsprintf(pathname, "%s", H5PLget(8)); if (strcmp(pathname, "a_path_7") != 0) { - fprintf(stderr," get 8: %s\n", pathname); + HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - sprintf(pathname, "%s", H5PLget(0)); + HDsprintf(pathname, "%s", H5PLget(0)); if (strcmp(pathname, "a_path_17") != 0) { - fprintf(stderr," get 0: %s\n", pathname); + HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } PASSED(); @@ -834,7 +866,7 @@ test_filter_path_apis(void) TESTING(" prepend (exceed)"); /* Exceed the max path prepend */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 18); + HDsprintf(pathname, "a_path_%d", 18); ret = H5PLprepend(pathname); } H5E_END_TRY if (ret >= 0) @@ -843,9 +875,9 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ - sprintf(pathname, "a_path_%d", 20); + HDsprintf(pathname, "a_path_%d", 20); if (H5PLput(pathname, 1) < 0) { - fprintf(stderr," replace 1: %s\n", pathname); + HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } @@ -853,14 +885,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were not moved */ - sprintf(pathname, "%s", H5PLget(0)); + HDsprintf(pathname, "%s", H5PLget(0)); if (strcmp(pathname, "a_path_17") != 0) { - fprintf(stderr," get 0: %s\n", pathname); + HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - sprintf(pathname, "%s", H5PLget(2)); + HDsprintf(pathname, "%s", H5PLget(2)); if (strcmp(pathname, "a_path_1") != 0) { - fprintf(stderr," get 2: %s\n", pathname); + HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR } PASSED(); @@ -870,9 +902,9 @@ test_filter_path_apis(void) if (H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(4)); + HDsprintf(pathname, "%s", H5PLget(4)); if (strcmp(pathname, "a_path_4") != 0) { - fprintf(stderr," get 4: %s\n", pathname); + HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); @@ -882,16 +914,16 @@ test_filter_path_apis(void) TESTING(" insert"); /* Insert one path*/ - sprintf(pathname, "a_path_%d", 21); + HDsprintf(pathname, "a_path_%d", 21); if (H5PLinsert(pathname, 3) < 0){ - fprintf(stderr," insert 3: %s\n", pathname); + HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR } /* Verify that the entries were moved */ - sprintf(pathname, "%s", H5PLget(4)); + HDsprintf(pathname, "%s", H5PLget(4)); if (strcmp(pathname, "a_path_2") != 0){ - fprintf(stderr," get 4: %s\n", pathname); + HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); @@ -902,7 +934,7 @@ test_filter_path_apis(void) TESTING(" insert (exceed)"); /* Exceed the max path insert */ H5E_BEGIN_TRY { - sprintf(pathname, "a_path_%d", 22); + HDsprintf(pathname, "a_path_%d", 22); ret = H5PLinsert(pathname, 12); } H5E_END_TRY if (ret >= 0) @@ -968,11 +1000,11 @@ main(void) /* Set the FAPL for the type of format */ if(new_format) { - puts("\nTesting with new file format:"); + HDputs("\nTesting with new file format:"); my_fapl = fapl2; } /* end if */ else { - puts("Testing with old file format:"); + HDputs("Testing with old file format:"); my_fapl = fapl; } /* end else */ @@ -997,7 +1029,7 @@ main(void) /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); - puts("\nTesting reading data with with dynamic plugin filters:"); + HDputs("\nTesting reading data with with dynamic plugin filters:"); /* Close the library so that all loaded plugin libraries are unloaded */ h5_reset(); @@ -1035,14 +1067,14 @@ main(void) if(nerrors) TEST_ERROR - printf("All plugin tests passed.\n"); + HDprintf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); return 0; error: nerrors = MAX(1, nerrors); - printf("***** %d PLUGIN TEST%s FAILED! *****\n", + HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } -- cgit v0.12 From 17bb6be1d8cd6f13f937de511e16da9a1774152b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:17:48 -0500 Subject: HDFFV-10143 Use Windows A version of ExpandEnvironmentStrings --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index f6af691..2a9b046 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -38,7 +38,7 @@ char *tempbuf; \ if(NULL == (tempbuf = (char *)H5MM_malloc(H5PL_EXPAND_BUFFER_SIZE))) \ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for expanded path") \ - if((bufCharCount = ExpandEnvironmentStrings(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ + if((bufCharCount = ExpandEnvironmentStringsA(dl_path, tempbuf, H5PL_EXPAND_BUFFER_SIZE)) > H5PL_EXPAND_BUFFER_SIZE) { \ tempbuf = (char *)H5MM_xfree(tempbuf); \ HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "expanded path is too long") \ } \ -- cgit v0.12 From 0bd67539d65658d3fc6dfe2a5f0d578909e81780 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 12:36:12 -0500 Subject: Remove redundant code --- src/H5PL.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 2a9b046..abd3ea2 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -47,8 +47,7 @@ HGOTO_ERROR(H5E_PLUGIN, H5E_CANTGET, FAIL, "failed to expand path") \ } \ dl_path = (char *)H5MM_xfree(dl_path); \ - dl_path = H5MM_strdup(tempbuf); \ - tempbuf = (char *)H5MM_xfree(tempbuf); \ + dl_path = tempbuf; \ } #else #define H5PL_EXPAND_ENV_VAR @@ -434,8 +433,8 @@ H5PLappend(char* plugin_path) H5PL_EXPAND_ENV_VAR - if(NULL == (H5PL_path_table_g[H5PL_num_paths_g] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[H5PL_num_paths_g] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -475,8 +474,8 @@ H5PLprepend(char* plugin_path) for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - if (NULL == (H5PL_path_table_g[0] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[0] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -513,8 +512,8 @@ H5PLput(char* plugin_path, unsigned int index) if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); - if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[index] = dl_path; + dl_path = NULL; done: if(dl_path) @@ -553,8 +552,8 @@ H5PLinsert(char* plugin_path, unsigned int index) for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; - if(NULL == (H5PL_path_table_g[index] = H5MM_strdup(dl_path))) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") + H5PL_path_table_g[index] = dl_path; + dl_path = NULL; H5PL_num_paths_g++; done: @@ -594,9 +593,6 @@ H5PLremove(unsigned int index) H5PL_path_table_g[H5PL_num_paths_g] = NULL; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLremove() */ -- cgit v0.12 From af4d79cbb6ab621414f5c72366dadc7910e7402a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 13:22:43 -0500 Subject: HDFFV-10143 change put to replace and add const --- src/H5PL.c | 12 ++++++------ src/H5PLpublic.h | 8 ++++---- test/plugin.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index abd3ea2..4bf19fc 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -417,7 +417,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(char* plugin_path) +H5PLappend(const char* plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -455,7 +455,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(char* plugin_path) +H5PLprepend(const char* plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -487,7 +487,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5PLput + * Function: H5PLreplace * * Purpose: Replace the path at the specified index. * @@ -496,7 +496,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLput(char* plugin_path, unsigned int index) +H5PLreplace(const char* plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -520,7 +520,7 @@ done: dl_path = (char *)H5MM_xfree(dl_path); FUNC_LEAVE_API(ret_value) -} /* end H5PLput() */ +} /* end H5PLreplace() */ /*------------------------------------------------------------------------- @@ -533,7 +533,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(char* plugin_path, unsigned int index) +H5PLinsert(const char* plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index f3fe497..ca46542 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -44,10 +44,10 @@ extern "C" { /* plugin state */ H5_DLL herr_t H5PLset_loading_state(unsigned int plugin_type); H5_DLL herr_t H5PLget_loading_state(unsigned int* plugin_type/*out*/); -H5_DLL herr_t H5PLappend(char* plugin_path); -H5_DLL herr_t H5PLprepend(char* plugin_path); -H5_DLL herr_t H5PLput(char* plugin_path, unsigned int index); -H5_DLL herr_t H5PLinsert(char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLappend(const char* plugin_path); +H5_DLL herr_t H5PLprepend(const char* plugin_path); +H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); +H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); H5_DLL const char* H5PLget(unsigned int index); H5_DLL unsigned int H5PLsize(void); diff --git a/test/plugin.c b/test/plugin.c index c739b72..359bbdd 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -876,7 +876,7 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ HDsprintf(pathname, "a_path_%d", 20); - if (H5PLput(pathname, 1) < 0) { + if (H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } -- cgit v0.12 From d29548351fa5c7976a771d02042020b9b133312b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 14:40:03 -0500 Subject: HDFFV-10143 change h5PLget to use buffer like H5Iget_name --- src/H5PL.c | 63 ++++++++++++++++++++++++++++---------------------------- src/H5PLpublic.h | 2 +- test/plugin.c | 53 ++++++++++++++++++++++++++++++++++++----------- 3 files changed, 74 insertions(+), 44 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 4bf19fc..0957629 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -428,19 +428,15 @@ H5PLappend(const char* plugin_path) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR H5PL_path_table_g[H5PL_num_paths_g] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLappend() */ @@ -466,8 +462,7 @@ H5PLprepend(const char* plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -475,13 +470,9 @@ H5PLprepend(const char* plugin_path) for (plindex = (unsigned int)H5PL_num_paths_g; plindex > 0; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; H5PL_path_table_g[0] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if (dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLprepend() */ @@ -504,8 +495,7 @@ H5PLreplace(const char* plugin_path, unsigned int index) FUNC_ENTER_API(FAIL) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -513,12 +503,8 @@ H5PLreplace(const char* plugin_path, unsigned int index) if(H5PL_path_table_g[index]) H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); H5PL_path_table_g[index] = dl_path; - dl_path = NULL; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLreplace() */ @@ -544,8 +530,7 @@ H5PLinsert(const char* plugin_path, unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); - if(NULL == dl_path) + if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") H5PL_EXPAND_ENV_VAR @@ -553,13 +538,9 @@ H5PLinsert(const char* plugin_path, unsigned int index) for(plindex = (unsigned int)H5PL_num_paths_g; plindex > index; plindex--) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex - 1]; H5PL_path_table_g[index] = dl_path; - dl_path = NULL; H5PL_num_paths_g++; done: - if(dl_path) - dl_path = (char *)H5MM_xfree(dl_path); - FUNC_LEAVE_API(ret_value) } /* end H5PLinsert() */ @@ -602,20 +583,40 @@ done: * * Purpose: Query the plugin path at the specified index. * - * Return: Non-NULL on success/NULL on failure + * Return: Success: The length of path. + * + * If `pathname' is non-NULL then write up to `size' bytes into that + * buffer and always return the length of the pathname. + * Otherwise `size' is ignored and the function does not store the pathname, + * just returning the number of characters required to store the pathname. + * If an error occurs then the buffer pointed to by `pathname' (NULL or non-NULL) + * is unchanged and the function returns a negative value. + * If a zero is returned for the name's length, then there is no pathname + * associated with the index. * *------------------------------------------------------------------------- */ -const char* -H5PLget(unsigned int index) +ssize_t +H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { - char* ret_value = NULL; /* Return value */ + ssize_t ret_value = FAIL; /* Return value */ + ssize_t len = 0; /* Length of pathname */ + char *dl_path = NULL; - FUNC_ENTER_API(NULL) + FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) - HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, NULL, "no directories in table") - if(NULL == (ret_value = H5PL_path_table_g[index])) - HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, NULL, "no directory path at index") + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(NULL == (dl_path = H5PL_path_table_g[index])) + HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + len = HDstrlen(dl_path); + if(pathname) { + HDstrncpy(pathname, dl_path, MIN((size_t)(len + 1), size)); + if((size_t)len >= size) + pathname[size - 1] = '\0'; + } /* end if */ + + /* Set return value */ + ret_value = len; done: FUNC_LEAVE_API(ret_value) diff --git a/src/H5PLpublic.h b/src/H5PLpublic.h index ca46542..5e4dcae 100644 --- a/src/H5PLpublic.h +++ b/src/H5PLpublic.h @@ -49,7 +49,7 @@ H5_DLL herr_t H5PLprepend(const char* plugin_path); H5_DLL herr_t H5PLreplace(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLinsert(const char* plugin_path, unsigned int index); H5_DLL herr_t H5PLremove(unsigned int index); -H5_DLL const char* H5PLget(unsigned int index); +H5_DLL ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size); H5_DLL unsigned int H5PLsize(void); #ifdef __cplusplus diff --git a/test/plugin.c b/test/plugin.c index 359bbdd..19a0ebd 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -744,6 +744,7 @@ test_filter_path_apis(void) int i; unsigned int ndx; herr_t ret; + int pathlen = -1; char pathname[256]; HDputs("Testing access to the filter path table"); @@ -801,18 +802,37 @@ test_filter_path_apis(void) TEST_ERROR PASSED(); - TESTING(" get (bounds)"); - HDsprintf(pathname, "%s", H5PLget(0)); + TESTING(" get (path name)"); + if ((pathlen = H5PLget(0, NULL, 0)) <= 0) { + HDfprintf(stderr," get path 0 length failed\n"); + TEST_ERROR + } + HDfprintf(stdout," get path 0 length %d\n", pathlen); + if (pathlen != 8) { + TEST_ERROR + } + if ((pathlen = H5PLget(0, pathname, 256)) <= 0) { + HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); + TEST_ERROR + } + HDfprintf(stdout," get path 0 length %d\n", pathlen); if (strcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(1)); + PASSED(); + + TESTING(" get (bounds)"); + if ((pathlen = H5PLget(1, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 1 length %d\n", pathlen); if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(15)); + if ((pathlen = H5PLget(15, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 15 length %d\n", pathlen); if (strcmp(pathname, "a_path_15") != 0) { HDfprintf(stderr," get 15: %s\n", pathname); TEST_ERROR @@ -820,16 +840,19 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if (H5PLget(16) != NULL) + if ((pathlen = H5PLget(16, NULL, 0)) > 0) TEST_ERROR PASSED(); + HDfprintf(stdout," get path 16 length %d\n", pathlen); TESTING(" remove (verify for prepend)"); /* Remove one path*/ if (H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(8)); + if ((pathlen = H5PLget(8, pathname, 256)) <= 0) + TEST_ERROR + HDfprintf(stdout," get path 8 length %d\n", pathlen); if (strcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR @@ -851,12 +874,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(8)); + if (H5PLget(8, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_7") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(0)); + if (H5PLget(0, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_17") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR @@ -885,12 +910,14 @@ test_filter_path_apis(void) if (H5PLsize() != 16) TEST_ERROR /* Verify that the entries were not moved */ - HDsprintf(pathname, "%s", H5PLget(0)); + if (H5PLget(0, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_17") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - HDsprintf(pathname, "%s", H5PLget(2)); + if (H5PLget(2, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR @@ -902,7 +929,8 @@ test_filter_path_apis(void) if (H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(4)); + if (H5PLget(4, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR @@ -921,7 +949,8 @@ test_filter_path_apis(void) } /* Verify that the entries were moved */ - HDsprintf(pathname, "%s", H5PLget(4)); + if (H5PLget(4, pathname, 256) <= 0) + TEST_ERROR if (strcmp(pathname, "a_path_2") != 0){ HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR -- cgit v0.12 From e51c624ac0b27e0a5aeff86cd338716ecf8c8b0c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 14:47:38 -0500 Subject: HDFFV-10143 remove debugging output --- test/plugin.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 19a0ebd..0fca40f 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -807,7 +807,6 @@ test_filter_path_apis(void) HDfprintf(stderr," get path 0 length failed\n"); TEST_ERROR } - HDfprintf(stdout," get path 0 length %d\n", pathlen); if (pathlen != 8) { TEST_ERROR } @@ -815,7 +814,6 @@ test_filter_path_apis(void) HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); TEST_ERROR } - HDfprintf(stdout," get path 0 length %d\n", pathlen); if (strcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR @@ -825,14 +823,12 @@ test_filter_path_apis(void) TESTING(" get (bounds)"); if ((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 1 length %d\n", pathlen); if (strcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } if ((pathlen = H5PLget(15, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 15 length %d\n", pathlen); if (strcmp(pathname, "a_path_15") != 0) { HDfprintf(stderr," get 15: %s\n", pathname); TEST_ERROR @@ -843,7 +839,6 @@ test_filter_path_apis(void) if ((pathlen = H5PLget(16, NULL, 0)) > 0) TEST_ERROR PASSED(); - HDfprintf(stdout," get path 16 length %d\n", pathlen); TESTING(" remove (verify for prepend)"); /* Remove one path*/ @@ -852,7 +847,6 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if ((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR - HDfprintf(stdout," get path 8 length %d\n", pathlen); if (strcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR -- cgit v0.12 From 51412aa48c6435ef7798f563fb269b13b6c0418c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 15:03:31 -0500 Subject: HDFFV-10143 Cleanup due to comments --- src/H5PL.c | 6 ++---- src/H5PLpkg.h | 4 ++-- test/plugin.c | 14 +++++++------- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 0957629..78ccd88 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -558,18 +558,16 @@ herr_t H5PLremove(unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ - char *dl_path = NULL; unsigned int plindex; FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") - if(NULL == (dl_path = H5PL_path_table_g[index])) + if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") + H5PL_path_table_g[plindex] = (char *)H5MM_xfree(H5PL_path_table_g[plindex]); for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; - if(H5PL_path_table_g[plindex]) - dl_path = (char *)H5MM_xfree(dl_path); H5PL_num_paths_g--; H5PL_path_table_g[H5PL_num_paths_g] = NULL; diff --git a/src/H5PLpkg.h b/src/H5PLpkg.h index 2761a33..5cf3096 100644 --- a/src/H5PLpkg.h +++ b/src/H5PLpkg.h @@ -29,13 +29,13 @@ /* Package Private Macros */ /**************************/ +#define H5PL_MAX_PATH_NUM 16 + /****************************/ /* Package Private Typedefs */ /****************************/ -#define H5PL_MAX_PATH_NUM 16 - /*****************************/ /* Package Private Variables */ diff --git a/test/plugin.c b/test/plugin.c index 0fca40f..3c1a71a 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -774,7 +774,7 @@ test_filter_path_apis(void) TESTING(" append"); /* Create multiple paths to fill table */ - for (i=0; i < 16; i++) { + for (i=0; i < H5PL_MAX_PATH_NUM; i++) { HDsprintf(pathname, "a_path_%d", i); if (H5PLappend(pathname) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); @@ -782,7 +782,7 @@ test_filter_path_apis(void) } } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -796,7 +796,7 @@ test_filter_path_apis(void) /* Exceed the max path removal */ H5E_BEGIN_TRY { - ret = H5PLremove(16); + ret = H5PLremove(H5PL_MAX_PATH_NUM); } H5E_END_TRY if (ret >= 0) TEST_ERROR @@ -836,7 +836,7 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if ((pathlen = H5PLget(16, NULL, 0)) > 0) + if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0)) > 0) TEST_ERROR PASSED(); @@ -865,7 +865,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ if (H5PLget(8, pathname, 256) <= 0) @@ -901,7 +901,7 @@ test_filter_path_apis(void) } /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ if (H5PLget(0, pathname, 256) <= 0) @@ -952,7 +952,7 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is full */ - if (H5PLsize() != 16) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ -- cgit v0.12 From b46aa5aff7119236fcbf726169bdc3ddaf69bc95 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 16:48:10 -0500 Subject: Fix code error and use H5PL_MAX_PATH_NUM in test --- src/H5PL.c | 3 +-- test/plugin.c | 30 +++++++++++++++++------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index 78ccd88..b5a55f5 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -427,7 +427,6 @@ H5PLappend(const char* plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") - dl_path = H5MM_strdup(plugin_path); if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -597,7 +596,7 @@ done: ssize_t H5PLget(unsigned int index, char *pathname/*out*/, size_t size) { - ssize_t ret_value = FAIL; /* Return value */ + ssize_t ret_value = 0; /* Return value */ ssize_t len = 0; /* Length of pathname */ char *dl_path = NULL; diff --git a/test/plugin.c b/test/plugin.c index 3c1a71a..19a1e42 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -746,6 +746,7 @@ test_filter_path_apis(void) herr_t ret; int pathlen = -1; char pathname[256]; + char tempname[256]; HDputs("Testing access to the filter path table"); @@ -788,7 +789,7 @@ test_filter_path_apis(void) TESTING(" append (exceed)"); /* Exceed the max path append */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 16); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); ret = H5PLappend(pathname); } H5E_END_TRY if (ret >= 0) @@ -827,10 +828,11 @@ test_filter_path_apis(void) HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - if ((pathlen = H5PLget(15, pathname, 256)) <= 0) + if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_15") != 0) { - HDfprintf(stderr," get 15: %s\n", pathname); + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); + if (strcmp(pathname, tempname") != 0) { + HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } PASSED(); @@ -854,13 +856,13 @@ test_filter_path_apis(void) PASSED(); /* Verify the table is not full */ - if (H5PLsize() != 15) TEST_ERROR + if (H5PLsize() != H5PL_MAX_PATH_NUM - 1) TEST_ERROR TESTING(" prepend"); /* Prepend one path*/ - HDsprintf(pathname, "a_path_%d", 17); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); if (H5PLprepend(pathname) < 0) { - HDfprintf(stderr," prepend 17: %s\n", pathname); + HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); TEST_ERROR } @@ -876,7 +878,8 @@ test_filter_path_apis(void) } if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_17") != 0) { + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if (strcmp(pathname, tempname") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -885,7 +888,7 @@ test_filter_path_apis(void) TESTING(" prepend (exceed)"); /* Exceed the max path prepend */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 18); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); ret = H5PLprepend(pathname); } H5E_END_TRY if (ret >= 0) @@ -894,7 +897,7 @@ test_filter_path_apis(void) TESTING(" replace"); /* Replace one path*/ - HDsprintf(pathname, "a_path_%d", 20); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); if (H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR @@ -906,7 +909,8 @@ test_filter_path_apis(void) /* Verify that the entries were not moved */ if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_17") != 0) { + HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); + if (strcmp(pathname, tempname") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -936,7 +940,7 @@ test_filter_path_apis(void) TESTING(" insert"); /* Insert one path*/ - HDsprintf(pathname, "a_path_%d", 21); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); if (H5PLinsert(pathname, 3) < 0){ HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR @@ -957,7 +961,7 @@ test_filter_path_apis(void) TESTING(" insert (exceed)"); /* Exceed the max path insert */ H5E_BEGIN_TRY { - HDsprintf(pathname, "a_path_%d", 22); + HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); ret = H5PLinsert(pathname, 12); } H5E_END_TRY if (ret >= 0) -- cgit v0.12 From e40a33f74da188ca7b633d6f6e79f698f518b650 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 16:55:33 -0500 Subject: HDFFV-10143 typo removed --- test/plugin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index 19a1e42..5dfdcc8 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -831,7 +831,7 @@ test_filter_path_apis(void) if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } -- cgit v0.12 From 8e663833939f5604c608ddaccdcb6cdb6d9d2003 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:03:08 -0500 Subject: HDFFV-10143 typo cleanup --- test/plugin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 5dfdcc8..b7ca52b 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -741,10 +741,10 @@ error: static herr_t test_filter_path_apis(void) { - int i; + unsigned int i; unsigned int ndx; herr_t ret; - int pathlen = -1; + ssize_t pathlen = -1; char pathname[256]; char tempname[256]; @@ -879,7 +879,7 @@ test_filter_path_apis(void) if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -910,7 +910,7 @@ test_filter_path_apis(void) if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname") != 0) { + if (strcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } -- cgit v0.12 From 1eb4693aa895fa13e35173907f65f92051ff0cd5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:11:50 -0500 Subject: HDFFV-10143 surround will fail with try block --- test/plugin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/plugin.c b/test/plugin.c index b7ca52b..fca8916 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -838,7 +838,10 @@ test_filter_path_apis(void) PASSED(); TESTING(" get (bounds exceed)"); - if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0)) > 0) + H5E_BEGIN_TRY { + pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); + } H5E_END_TRY + if (pathlen > 0) TEST_ERROR PASSED(); -- cgit v0.12 From 0892bf320cba6e5a3b83db41519a4000c2f5e3c4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 30 Mar 2017 17:40:44 -0500 Subject: HDFFV-10143 fix use before set --- src/H5PL.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5PL.c b/src/H5PL.c index b5a55f5..fe7b26b 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -564,7 +564,7 @@ H5PLremove(unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") - H5PL_path_table_g[plindex] = (char *)H5MM_xfree(H5PL_path_table_g[plindex]); + H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; H5PL_num_paths_g--; -- cgit v0.12 From d86d708aea48a4ca3d569c1c00c7bfa45e54e6dd Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 3 Apr 2017 11:33:01 -0500 Subject: Update tools issues --- release_docs/RELEASE.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 22accd3..9780dc2 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -77,7 +77,7 @@ New Features The page buffering layer in the HDF5 library absorbs small accesses to the file system. Each page in memory corresponds to a page allocated in the file. Access to the file system is then performed as a single page - or multiple of pages, if they are contiguous. This ensures that small + or multiple of pages, if they are contiguous. This ensures that small accesses to the file system are avoided while providing another caching layer for improved I/O performance. This feature works in conjunction with the paged aggregation feature. @@ -139,7 +139,7 @@ Bug Fixes since HDF5-1.10.0-patch1 release (HDFFV-9940 VC 2016/07/03, 2016/07/06) - (a) Throw an error instead of assertion when v1 btree level hits the 1 byte limit. - (b) Modifications to better handle error recovery when conversion by + (b) Modifications to better handle error recovery when conversion by h5format_convert fails. (HDFFV-9434 VC 2016/05/29) @@ -172,6 +172,13 @@ Bug Fixes since HDF5-1.10.0-patch1 release - h5repack now correctly parses the command line filter options. (HDFFV-10046 ADB 2017/01/24) + - h5diff correctly indicates error when it cannot read data due + to an unavailable filter plugin. + (HDFFV-9994 ADB 2017/01/18) + + - h5repack allows the --enable-error-stack option on the command line. + (HDFFV-775 ADB 2016/08/08) + High-Level APIs: ------ - -- cgit v0.12 From 1f88a34fa75861d862a8186015e9238a426ea743 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 3 Apr 2017 12:34:17 -0500 Subject: Update with checks for index bounds --- src/H5PL.c | 11 ++++++++++- test/plugin.c | 25 ++++++++++++++----------- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index fe7b26b..bfa3ace 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -494,6 +494,8 @@ H5PLreplace(const char* plugin_path, unsigned int index) FUNC_ENTER_API(FAIL) if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -529,6 +531,8 @@ H5PLinsert(const char* plugin_path, unsigned int index) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "too many directories in path for table") if(NULL == plugin_path) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no path provided") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5MM_strdup(plugin_path))) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "can't allocate memory for path") @@ -562,12 +566,15 @@ H5PLremove(unsigned int index) FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == H5PL_path_table_g[index]) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") H5PL_path_table_g[index] = (char *)H5MM_xfree(H5PL_path_table_g[index]); + + H5PL_num_paths_g--; for(plindex = index; plindex < (unsigned int)H5PL_num_paths_g; plindex++) H5PL_path_table_g[plindex] = H5PL_path_table_g[plindex + 1]; - H5PL_num_paths_g--; H5PL_path_table_g[H5PL_num_paths_g] = NULL; done: @@ -603,6 +610,8 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) FUNC_ENTER_API(FAIL) if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") + if(index >= H5PL_MAX_PATH_NUM) + HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "index path out of bounds for table") if(NULL == (dl_path = H5PL_path_table_g[index])) HGOTO_ERROR(H5E_PLUGIN, H5E_CANTALLOC, FAIL, "no directory path at index") len = HDstrlen(dl_path); diff --git a/test/plugin.c b/test/plugin.c index fca8916..6c14062 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -750,6 +750,8 @@ test_filter_path_apis(void) HDputs("Testing access to the filter path table"); + if(H5Zfilter_avail(H5Z_FILTER_DYNLIB1) != TRUE) TEST_ERROR + ndx = H5PLsize(); TESTING(" remove"); @@ -764,7 +766,7 @@ test_filter_path_apis(void) if (H5PLsize() > 0) TEST_ERROR PASSED(); - TESTING(" remove (exceed)"); + TESTING(" remove (exceed min)"); /* Exceed the min path removal */ H5E_BEGIN_TRY { ret = H5PLremove(0); @@ -795,6 +797,7 @@ test_filter_path_apis(void) if (ret >= 0) TEST_ERROR + TESTING(" remove (exceed max)"); /* Exceed the max path removal */ H5E_BEGIN_TRY { ret = H5PLremove(H5PL_MAX_PATH_NUM); @@ -815,7 +818,7 @@ test_filter_path_apis(void) HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); TEST_ERROR } - if (strcmp(pathname, "a_path_0") != 0) { + if (HDstrcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -824,14 +827,14 @@ test_filter_path_apis(void) TESTING(" get (bounds)"); if ((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_1") != 0) { + if (HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if (strcmp(pathname, tempname) != 0) { + if (HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } @@ -852,7 +855,7 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if ((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_9") != 0) { + if (HDstrcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } @@ -875,14 +878,14 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if (H5PLget(8, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_7") != 0) { + if (HDstrcmp(pathname, "a_path_7") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname) != 0) { + if (HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -913,13 +916,13 @@ test_filter_path_apis(void) if (H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (strcmp(pathname, tempname) != 0) { + if (HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } if (H5PLget(2, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_1") != 0) { + if (HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR } @@ -932,7 +935,7 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if (H5PLget(4, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_4") != 0) { + if (HDstrcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } @@ -952,7 +955,7 @@ test_filter_path_apis(void) /* Verify that the entries were moved */ if (H5PLget(4, pathname, 256) <= 0) TEST_ERROR - if (strcmp(pathname, "a_path_2") != 0){ + if (HDstrcmp(pathname, "a_path_2") != 0){ HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } -- cgit v0.12 From 1e4b2588b671a2172827bb422aee9ba96c0320b6 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 3 Apr 2017 11:56:52 -0700 Subject: Switch to using flag in signal handler, to trigger dropping out of main loop and shutdown cleanly, instead of calling leave() from the signal handler. --- hl/tools/h5watch/h5watch.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/hl/tools/h5watch/h5watch.c b/hl/tools/h5watch/h5watch.c index 97dca7a..f37b2b4 100644 --- a/hl/tools/h5watch/h5watch.c +++ b/hl/tools/h5watch/h5watch.c @@ -43,6 +43,7 @@ static int g_display_width = 80; /* output width in characters */ static hbool_t g_simple_output = FALSE; /* make output more machine-readable */ static unsigned g_retry = DEFAULT_RETRY; /* # of times to try opening the file if somehow file is unstable */ static hbool_t g_display_hex = FALSE; /* display data in hexadecimal format : LATER */ +static hbool_t g_user_interrupt = FALSE; /* Flag to indicate that user interrupted execution */ static herr_t doprint(hid_t did, hsize_t *start, hsize_t *block, int rank); static herr_t slicendump(hid_t did, hsize_t *prev_dims, hsize_t *cur_dims, @@ -337,7 +338,8 @@ monitor_dataset(hid_t fid, char *dsetname) goto done; } - while(1) { + /* Loop until an error occurs or the user interrupts execution */ + while(!g_user_interrupt) { /* Refreshes the dataset */ if(H5Drefresh(did) < 0) { @@ -798,9 +800,8 @@ parse_command_line(int argc, const char *argv[]) */ static void catch_signal(int H5_ATTR_UNUSED signo) { - /* Exit from h5watch */ - leave(EXIT_SUCCESS); - + /* Set the flag to get out of the main loop */ + g_user_interrupt = TRUE; } /* catch_signal() */ -- cgit v0.12 From 4bd667bfde558d7ac3fd348d9954ab572e6eb026 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 3 Apr 2017 14:06:47 -0500 Subject: HDFFV-10143 Add plugin APIs to Java interface --- java/src/hdf/hdf5lib/H5.java | 72 +++++++++++++++++++ java/src/jni/h5plImp.c | 161 ++++++++++++++++++++++++++++++++++++++++++ java/src/jni/h5plImp.h | 63 +++++++++++++++++ java/test/JUnit-interface.txt | 3 +- java/test/TestH5PL.java | 30 ++++++++ 5 files changed, 328 insertions(+), 1 deletion(-) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index a1099d8..88bd0e5 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -7202,6 +7202,78 @@ public class H5 implements java.io.Serializable { **/ public synchronized static native int H5PLget_loading_state() throws HDF5LibraryException; + /** + * H5PLappend inserts the plugin path at the end of the table. + * + * @param plugin_path + * IN: Path for location of filter plugin libraries. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5PLappend(String plugin_path) throws HDF5LibraryException; + + /** + * H5PLprepend inserts the plugin path at the beginning of the table. + * + * @param plugin_path + * IN: Path for location of filter plugin libraries. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5PLprepend(String plugin_path) throws HDF5LibraryException; + + /** + * H5PLreplace replaces the plugin path at the specified index. + * + * @param plugin_path + * IN: Path for location of filter plugin libraries. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5PLreplace(String plugin_path, int index) throws HDF5LibraryException; + + /** + * H5PLinsert inserts the plugin path at the specified index. + * + * @param plugin_path + * IN: Path for location of filter plugin libraries. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5PLinsert(String plugin_path, int index) throws HDF5LibraryException; + + /** + * H5PLremove removes the plugin path at the specified index. + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native void H5PLremove(int index) throws HDF5LibraryException; + + /** + * H5PLget retrieves the plugin path at the specified index. + * + * @return the current path at the index in plugin path table + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native String H5PLget(int index) throws HDF5LibraryException; + + /** + * H5PLsize retrieves the size of the current list of plugin paths. + * + * @return the current number of paths in the plugin path table + * + * @exception HDF5LibraryException + * - Error from the HDF-5 Library. + **/ + public synchronized static native int H5PLsize() throws HDF5LibraryException; + // //////////////////////////////////////////////////////////// // // // H5R: HDF5 1.8 Reference API Functions // diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 59de3cf..34d6f8b 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -61,6 +61,167 @@ Java_hdf_hdf5lib_H5_H5PLget_1loading_1state return (jint)plugin_type; } /* end Java_hdf_hdf5lib_H5_H5PLget_1loading_1state */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLappend + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLappend + (JNIEnv *env, jclass clss, jobjectArray plugin_path) +{ + char *aName; + herr_t retVal = -1; + + PIN_JAVA_STRING(plugin_path, aName); + if (aName != NULL) { + retVal = H5PLappend(aName); + + UNPIN_JAVA_STRING(plugin_path, aName); + + if (retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5PLappend */ +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLprepend + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLprepend + (JNIEnv *env, jclass clss, jobjectArray plugin_path) +{ + char *aName; + herr_t retVal = -1; + + PIN_JAVA_STRING(plugin_path, aName); + if (aName != NULL) { + retVal = H5PLprepend(aName); + + UNPIN_JAVA_STRING(plugin_path, aName); + + if (retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5PLprepend */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLreplace + * Signature: (Ljava/lang/String;I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLreplace + (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) +{ + char *aName; + herr_t retVal = -1; + + PIN_JAVA_STRING(plugin_path, aName); + if (aName != NULL) { + retVal = H5PLreplace(aName, index); + + UNPIN_JAVA_STRING(plugin_path, aName); + + if (retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5PLreplace */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLinsert + * Signature: (Ljava/lang/String;I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLinsert + (JNIEnv *env, jclass clss, jobjectArray plugin_path, jint index) +{ + char *aName; + herr_t retVal = -1; + + PIN_JAVA_STRING(plugin_path, aName); + if (aName != NULL) { + retVal = H5PLinsert(aName, index); + + UNPIN_JAVA_STRING(plugin_path, aName); + + if (retVal < 0) + h5libraryError(env); + } +} /* end Java_hdf_hdf5lib_H5_H5PLinsert */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLremove + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLremove + (JNIEnv *env, jclass clss, jint index) +{ + if (H5PLremove(index) < 0) + h5libraryError(env); +} /* end Java_hdf_hdf5lib_H5_H5PLremove */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLget + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5PLget + (JNIEnv *env, jclass clss, jint index) +{ + char *aName; + jstring str = NULL; + ssize_t buf_size; + + /* get the length of the name */ + buf_size = H5PLget(index, NULL, 0); + + if (buf_size <= 0) { + h5badArgument(env, "H5PLget: buf_size <= 0"); + } /* end if */ + else { + buf_size++; /* add extra space for the null terminator */ + aName = (char*)HDmalloc(sizeof(char) * (size_t)buf_size); + if (aName == NULL) { + h5outOfMemory(env, "H5PLget: malloc failed"); + } /* end if */ + else { + buf_size = H5PLget(index, aName, (size_t)buf_size); + if (buf_size < 0) { + h5libraryError(env); + } /* end if */ + else { + str = ENVPTR->NewStringUTF(ENVPAR aName); + } + HDfree(aName); + } + } + return str; +} /* end Java_hdf_hdf5lib_H5_H5PLget */ + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLsize + * Signature: (V)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5PLsize + (JNIEnv *env, jclass clss) +{ + int retVal = -1; + + retVal = H5PLsize(); + if (retVal < 0) + h5libraryError(env); + + return (jint)retVal; +} /* end Java_hdf_hdf5lib_H5_H5PLsize */ + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/src/jni/h5plImp.h b/java/src/jni/h5plImp.h index d0507a8..5326a94 100644 --- a/java/src/jni/h5plImp.h +++ b/java/src/jni/h5plImp.h @@ -41,6 +41,69 @@ JNIEXPORT jint JNICALL Java_hdf_hdf5lib_H5_H5PLget_1loading_1state (JNIEnv *, jclass); +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLappend + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLappend + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLprepend + * Signature: (Ljava/lang/String;)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLprepend + (JNIEnv *, jclass, jobjectArray); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLreplace + * Signature: (Ljava/lang/String;I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLreplace + (JNIEnv *, jclass, jobjectArray, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLinsert + * Signature: (Ljava/lang/String;I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLinsert + (JNIEnv *, jclass, jobjectArray, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLremove + * Signature: (I)V + */ +JNIEXPORT void JNICALL +Java_hdf_hdf5lib_H5_H5PLremove + (JNIEnv *, jclass, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLget + * Signature: (I)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL +Java_hdf_hdf5lib_H5_H5PLget + (JNIEnv *, jclass, jint); + +/* + * Class: hdf_hdf5lib_H5 + * Method: H5PLsize + * Signature: (V)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5PLsize + (JNIEnv *, jclass); + #ifdef __cplusplus } /* end extern "C" */ #endif /* __cplusplus */ diff --git a/java/test/JUnit-interface.txt b/java/test/JUnit-interface.txt index cae8cef..ab2f3b1 100644 --- a/java/test/JUnit-interface.txt +++ b/java/test/JUnit-interface.txt @@ -633,13 +633,14 @@ JUnit version 4.11 .testH5Ocomment_clear .testH5Ocopy_cur_not_exists .TestH5PLplugins +.TestH5PLpaths .testH5Zfilter_avail .testH5Zunregister_predefined .testH5Zget_filter_info Time: XXXX -OK (637 tests) +OK (638 tests) HDF5-DIAG: Error detected in HDF5 (version (number)) thread (IDs): #000: (file name) line (number) in H5Fopen(): can't set access and transfer property lists diff --git a/java/test/TestH5PL.java b/java/test/TestH5PL.java index 9f1876c..759db5f 100644 --- a/java/test/TestH5PL.java +++ b/java/test/TestH5PL.java @@ -69,6 +69,36 @@ public class TestH5PL { } } + @Test + public void TestH5PLpaths() { + try { + int original_entries = H5.H5PLsize(); + H5.H5PLappend("path_one"); + int plugin_entries = H5.H5PLsize(); + assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+1) == plugin_entries); + H5.H5PLprepend("path_two"); + plugin_entries = H5.H5PLsize(); + assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries); + H5.H5PLinsert("path_three", original_entries); + plugin_entries = H5.H5PLsize(); + assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+3) == plugin_entries); + String first_path = H5.H5PLget(original_entries); + assertTrue("First path was : "+first_path + " ",first_path.compareToIgnoreCase("path_three")==0); + H5.H5PLreplace("path_four", original_entries); + first_path = H5.H5PLget(original_entries); + assertTrue("First path changed to : "+first_path + " ",first_path.compareToIgnoreCase("path_four")==0); + H5.H5PLremove(original_entries); + first_path = H5.H5PLget(original_entries); + assertTrue("First path now : "+first_path + " ",first_path.compareToIgnoreCase("path_two")==0); + plugin_entries = H5.H5PLsize(); + assertTrue("H5.H5PLsize: "+plugin_entries, (original_entries+2) == plugin_entries); + } + catch (Throwable err) { + err.printStackTrace(); + fail("TestH5PLpaths " + err); + } + } + @Ignore public void TestH5PLdlopen() { long file_id = -1; -- cgit v0.12 From cbdc1250ce40a7476fc1df69710b2138dd1774ac Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 09:53:42 -0500 Subject: HDFFV-10143 clean up format and function return --- test/plugin.c | 654 +++++++++++++++++++++++++++------------------------------- 1 file changed, 306 insertions(+), 348 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 6c14062..6d4a0e1 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -44,8 +44,8 @@ const char *FILENAME[] = { /* Dataset names for testing filters */ #define DSET_DEFLATE_NAME "deflate" #define DSET_DYNLIB1_NAME "dynlib1" -#define DSET_DYNLIB2_NAME "dynlib2" -#define DSET_DYNLIB4_NAME "dynlib4" +#define DSET_DYNLIB2_NAME "dynlib2" +#define DSET_DYNLIB4_NAME "dynlib4" /* Parameters for internal filter test */ #define FILTER_CHUNK_DIM1 2 @@ -65,39 +65,36 @@ const char *FILENAME[] = { #define GROUP_ITERATION 1000 int points_deflate[DSET_DIM1][DSET_DIM2], - points_dynlib1[DSET_DIM1][DSET_DIM2], - points_dynlib2[DSET_DIM1][DSET_DIM2], - points_dynlib4[DSET_DIM1][DSET_DIM2], - points_bzip2[DSET_DIM1][DSET_DIM2]; + points_dynlib1[DSET_DIM1][DSET_DIM2], + points_dynlib2[DSET_DIM1][DSET_DIM2], + points_dynlib4[DSET_DIM1][DSET_DIM2], + points_bzip2[DSET_DIM1][DSET_DIM2]; /*------------------------------------------------------------------------- - * Function: test_filter_internal + * Function: test_filter_internal * - * Purpose: Tests writing entire data and partial data with filters + * Purpose: Tests writing entire data and partial data with filters * * Return: Success: 0 - * Failure: -1 - * - * Programmer: Raymond Lu - * 27 February 2013 - * + * Failure: -1 *------------------------------------------------------------------------- */ static herr_t test_filter_internal(hid_t fid, const char *name, hid_t dcpl) { - hid_t dataset; /* Dataset ID */ - hid_t dxpl; /* Dataset xfer property list ID */ - hid_t write_dxpl; /* Dataset xfer property list ID for writing */ - hid_t sid; /* Dataspace ID */ - const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ + herr_t ret_value = -1; + hid_t dataset = -1; /* Dataset ID */ + hid_t dxpl = -1; /* Dataset xfer property list ID */ + hid_t write_dxpl = -1; /* Dataset xfer property list ID for writing */ + hid_t sid = -1; /* Dataspace ID */ + const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */ const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */ - const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ + const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */ void *tconv_buf = NULL; /* Temporary conversion buffer */ - int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; - size_t i, j; /* Local index variables */ - int n = 0; + int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; + size_t i, j; /* Local index variables */ + int n = 0; /* Create the data space */ if((sid = H5Screate_simple(2, size, NULL)) < 0) TEST_ERROR @@ -114,15 +111,14 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (setup)"); /* Check if all the filters are available */ - if(H5Pall_filters_avail(dcpl)!=TRUE) { + if(H5Pall_filters_avail(dcpl) != TRUE) { H5_FAILED(); - HDprintf(" Line %d: Incorrect filter availability\n",__LINE__); + HDprintf(" Line %d: Incorrect filter availability\n", __LINE__); TEST_ERROR } /* end if */ /* Create the dataset */ - if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, - dcpl, H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset = H5Dcreate2(fid, name, H5T_NATIVE_INT, sid, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) TEST_ERROR PASSED(); @@ -132,20 +128,16 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) */ TESTING(" filters (uninitialized read)"); - if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) - TEST_ERROR; + if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check) < 0) TEST_ERROR; - for(i=0; i<(size_t)size[0]; i++) { - for(j=0; j<(size_t)size[1]; j++) { - if(0!=check[i][j]) { - H5_FAILED(); - HDprintf(" Read a non-zero value.\n"); - HDprintf(" At index %lu,%lu\n", - (unsigned long)i, (unsigned long)j); - TEST_ERROR - } - } - } + for(i=0; i<(size_t)size[0]; i++) + for(j=0; j<(size_t)size[1]; j++) + if(0 != check[i][j]) { + H5_FAILED(); + HDprintf(" Read a non-zero value.\n"); + HDprintf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); + TEST_ERROR + } /* end if */ PASSED(); /*---------------------------------------------------------------------- @@ -156,14 +148,11 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl) TESTING(" filters (write)"); n = 0; - for(i=0; i 0; i--) { - if (H5PLremove(i-1) < 0) { + for(i=ndx; i > 0; i--) + if(H5PLremove(i-1) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR - } - } + } /* end if */ /* Verify the table is empty */ - if (H5PLsize() > 0) TEST_ERROR + if(H5PLsize() > 0) TEST_ERROR PASSED(); TESTING(" remove (exceed min)"); @@ -771,21 +751,20 @@ test_filter_path_apis(void) H5E_BEGIN_TRY { ret = H5PLremove(0); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" append"); /* Create multiple paths to fill table */ - for (i=0; i < H5PL_MAX_PATH_NUM; i++) { + for(i=0; i < H5PL_MAX_PATH_NUM; i++) { HDsprintf(pathname, "a_path_%d", i); - if (H5PLappend(pathname) < 0) { + if(H5PLappend(pathname) < 0) { HDfprintf(stderr," at %d: %s\n", i, pathname); TEST_ERROR } } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR PASSED(); TESTING(" append (exceed)"); @@ -794,47 +773,42 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM); ret = H5PLappend(pathname); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR TESTING(" remove (exceed max)"); /* Exceed the max path removal */ H5E_BEGIN_TRY { ret = H5PLremove(H5PL_MAX_PATH_NUM); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" get (path name)"); - if ((pathlen = H5PLget(0, NULL, 0)) <= 0) { + if((pathlen = H5PLget(0, NULL, 0)) <= 0) { HDfprintf(stderr," get path 0 length failed\n"); TEST_ERROR } - if (pathlen != 8) { - TEST_ERROR - } - if ((pathlen = H5PLget(0, pathname, 256)) <= 0) { + if(pathlen != 8) TEST_ERROR + + if((pathlen = H5PLget(0, pathname, 256)) <= 0) { HDfprintf(stderr," get 0 len: %d : %s\n", pathlen, pathname); TEST_ERROR } - if (HDstrcmp(pathname, "a_path_0") != 0) { + if(HDstrcmp(pathname, "a_path_0") != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } PASSED(); TESTING(" get (bounds)"); - if ((pathlen = H5PLget(1, pathname, 256)) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_1") != 0) { + if((pathlen = H5PLget(1, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 1: %s\n", pathname); TEST_ERROR } - if ((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) - TEST_ERROR + if((pathlen = H5PLget(H5PL_MAX_PATH_NUM - 1, pathname, 256)) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM - 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get %d: %s\n", H5PL_MAX_PATH_NUM - 1, pathname); TEST_ERROR } @@ -844,18 +818,16 @@ test_filter_path_apis(void) H5E_BEGIN_TRY { pathlen = H5PLget(H5PL_MAX_PATH_NUM, NULL, 0); } H5E_END_TRY - if (pathlen > 0) - TEST_ERROR + if(pathlen > 0) TEST_ERROR PASSED(); TESTING(" remove (verify for prepend)"); /* Remove one path*/ - if (H5PLremove(8) < 0) TEST_ERROR + if(H5PLremove(8) < 0) TEST_ERROR /* Verify that the entries were moved */ - if ((pathlen = H5PLget(8, pathname, 256)) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_9") != 0) { + if((pathlen = H5PLget(8, pathname, 256)) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_9") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } @@ -867,25 +839,23 @@ test_filter_path_apis(void) TESTING(" prepend"); /* Prepend one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (H5PLprepend(pathname) < 0) { + if(H5PLprepend(pathname) < 0) { HDfprintf(stderr," prepend %d: %s\n", H5PL_MAX_PATH_NUM + 1, pathname); TEST_ERROR } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were moved */ - if (H5PLget(8, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_7") != 0) { + if(H5PLget(8, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_7") != 0) { HDfprintf(stderr," get 8: %s\n", pathname); TEST_ERROR } - if (H5PLget(0, pathname, 256) <= 0) - TEST_ERROR + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } @@ -897,32 +867,29 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 2); ret = H5PLprepend(pathname); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR PASSED(); TESTING(" replace"); /* Replace one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 4); - if (H5PLreplace(pathname, 1) < 0) { + if(H5PLreplace(pathname, 1) < 0) { HDfprintf(stderr," replace 1: %s\n", pathname); TEST_ERROR } /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR /* Verify that the entries were not moved */ - if (H5PLget(0, pathname, 256) <= 0) - TEST_ERROR + if(H5PLget(0, pathname, 256) <= 0) TEST_ERROR HDsprintf(tempname, "a_path_%d", H5PL_MAX_PATH_NUM + 1); - if (HDstrcmp(pathname, tempname) != 0) { + if(HDstrcmp(pathname, tempname) != 0) { HDfprintf(stderr," get 0: %s\n", pathname); TEST_ERROR } - if (H5PLget(2, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_1") != 0) { + if(H5PLget(2, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_1") != 0) { HDfprintf(stderr," get 2: %s\n", pathname); TEST_ERROR } @@ -930,39 +897,37 @@ test_filter_path_apis(void) TESTING(" remove (verify for insert)"); /* Remove one path*/ - if (H5PLremove(4) < 0) TEST_ERROR + if H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - if (H5PLget(4, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_4") != 0) { + if H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); /* Verify the table is not full */ - if (H5PLsize() != 15) TEST_ERROR + if(H5PLsize() != 15) TEST_ERROR TESTING(" insert"); /* Insert one path*/ HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 5); - if (H5PLinsert(pathname, 3) < 0){ + if(H5PLinsert(pathname, 3) < 0) { HDfprintf(stderr," insert 3: %s\n", pathname); TEST_ERROR } /* Verify that the entries were moved */ - if (H5PLget(4, pathname, 256) <= 0) - TEST_ERROR - if (HDstrcmp(pathname, "a_path_2") != 0){ + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(HDstrcmp(pathname, "a_path_2") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR } PASSED(); /* Verify the table is full */ - if (H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR + if(H5PLsize() != H5PL_MAX_PATH_NUM) TEST_ERROR TESTING(" insert (exceed)"); /* Exceed the max path insert */ @@ -970,15 +935,14 @@ test_filter_path_apis(void) HDsprintf(pathname, "a_path_%d", H5PL_MAX_PATH_NUM + 6); ret = H5PLinsert(pathname, 12); } H5E_END_TRY - if (ret >= 0) - TEST_ERROR + if(ret >= 0) TEST_ERROR - PASSED (); + PASSED(); - return 0; + ret_value = 0; error: - return -1; + return ret_value; } @@ -1000,24 +964,24 @@ int main(void) { char filename[FILENAME_BUF_SIZE]; - hid_t file, fapl, fapl2; - unsigned new_format; - int mdc_nelmts; - size_t rdcc_nelmts; - size_t rdcc_nbytes; - double rdcc_w0; - int nerrors = 0; + hid_t file = -1; + hid_t fapl = -1; + hid_t fapl2 = -1; + unsigned new_format; + int mdc_nelmts; + size_t rdcc_nelmts; + size_t rdcc_nbytes; + double rdcc_w0; + int nerrors = 0; /* Testing setup */ h5_reset(); fapl = h5_fileaccess(); /* Turn off the chunk cache, so all the chunks are immediately written to disk */ - if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) - TEST_ERROR + if(H5Pget_cache(fapl, &mdc_nelmts, &rdcc_nelmts, &rdcc_nbytes, &rdcc_w0) < 0) TEST_ERROR rdcc_nbytes = 0; - if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) - TEST_ERROR + if(H5Pset_cache(fapl, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, rdcc_w0) < 0) TEST_ERROR /* Copy the file access property list */ if((fapl2 = H5Pcopy(fapl)) < 0) TEST_ERROR @@ -1042,8 +1006,7 @@ main(void) } /* end else */ /* Create the file for this test */ - if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) - TEST_ERROR + if((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, my_fapl)) < 0) TEST_ERROR /* Test dynamically loaded filters for chunked dataset */ nerrors += (test_filters_for_datasets(file) < 0 ? 1 : 0); @@ -1051,8 +1014,7 @@ main(void) /* Test dynamically loaded filters for groups */ nerrors += (test_filters_for_groups(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR } /* end for */ /* Close FAPL */ @@ -1069,14 +1031,13 @@ main(void) fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with filters */ - nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_read_with_filters(file) < 0 ? 1 : 0); /* Open the groups with filters */ - nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); + nerrors += (test_groups_with_filters(file) < 0 ? 1 : 0); /* Restore the default error handler (set in h5_reset()) */ h5_restore_err(); @@ -1086,20 +1047,18 @@ main(void) fapl = h5_fileaccess(); /* Reopen the file for testing data reading */ - if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) - TEST_ERROR + if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) TEST_ERROR /* Read the data with disabled filters */ nerrors += (test_noread_with_filters(file) < 0 ? 1 : 0); - if(H5Fclose(file) < 0) - TEST_ERROR + if(H5Fclose(file) < 0) TEST_ERROR /* Test the APIs for access to the filter plugin path table */ nerrors += (test_filter_path_apis() < 0 ? 1 : 0); - if(nerrors) - TEST_ERROR + if(nerrors) TEST_ERROR + HDprintf("All plugin tests passed.\n"); h5_cleanup(FILENAME, fapl); @@ -1107,8 +1066,7 @@ main(void) error: nerrors = MAX(1, nerrors); - HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", - nerrors, 1 == nerrors ? "" : "S"); + HDprintf("***** %d PLUGIN TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return 1; } -- cgit v0.12 From 9b17c2e12412492cc34f302be2cf9293109d6726 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 10:07:41 -0500 Subject: HDFFV-10143 Update new feature section. --- release_docs/RELEASE.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 9780dc2..be8cec8 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -82,6 +82,10 @@ New Features layer for improved I/O performance. This feature works in conjunction with the paged aggregation feature. + - Filter plugin API added to access the table of paths to search for a + library. Java interface expanded with wrappers for the new functions. + (HDFFV-10143 ADB 2017/04/04) + Parallel Library: ----------------- - -- cgit v0.12 From c2941faa6673022218b365ead5be24b02c47ab6a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 4 Apr 2017 10:15:56 -0500 Subject: Fix typo deletion --- test/plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/plugin.c b/test/plugin.c index 6d4a0e1..041f702 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -897,10 +897,10 @@ test_filter_path_apis(void) TESTING(" remove (verify for insert)"); /* Remove one path*/ - if H5PLremove(4) < 0) TEST_ERROR + if(H5PLremove(4) < 0) TEST_ERROR /* Verify that the entries were moved */ - if H5PLget(4, pathname, 256) <= 0) TEST_ERROR + if(H5PLget(4, pathname, 256) <= 0) TEST_ERROR if(HDstrcmp(pathname, "a_path_4") != 0) { HDfprintf(stderr," get 4: %s\n", pathname); TEST_ERROR -- cgit v0.12 From f060e05999849c1eb3ef653c08977e4b154749d8 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Tue, 4 Apr 2017 20:20:12 -0400 Subject: Re-enabled fixed array index testing in the test_random_rank4_vl() test in test/set_extent. This was fixed some time ago, but the test was never re-enabled for that index type. --- test/set_extent.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/test/set_extent.c b/test/set_extent.c index 17dc6a0..949120b 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -2603,10 +2603,12 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /*!FIXME Skip the test if a fixed array index is requested, as resizing - * fixed arrays is broken now. Extensible arrays are also broken. Remove - * these lines as appropriate when these problems are fixed. */ - /* Fixed Array index type is now fixed */ + /* *** FIXME *** + * Skip the test if an extensible array index is requested, as resizing + * them is broken. + * + * Remove these lines as appropriate when these problems are fixed. + */ if(index_type == RANK4_INDEX_EARRAY) return 0; @@ -2814,10 +2816,13 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /*!FIXME Skip the test if a fixed array index is requested, as resizing - * fixed arrays is broken now. Extensible arrays are also broken. Remove - * these lines as appropriate when these problems are fixed. */ - if(index_type == RANK4_INDEX_FARRAY || index_type == RANK4_INDEX_EARRAY) + /* *** FIXME *** + * Skip the test if an extensible array index is requested, as resizing + * them is broken. + * + * Remove these lines as appropriate when these problems are fixed. + */ + if(index_type == RANK4_INDEX_EARRAY) return 0; /* Initialize fill value buffers so they aren't freed in case of an error */ -- cgit v0.12 From 2e295975b9c5fd4c845529aa2eacdb89eec4c172 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Feb 2017 11:45:13 -0500 Subject: Updated an error message in H5L.c to be more helpful. Fixes HDFFV-10141. --- src/H5L.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/H5L.c b/src/H5L.c index b5c6240..f933e97 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2351,9 +2351,11 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, if(name == NULL) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "name doesn't exist") - /* Check for removing '.' */ + /* Check for non-existent (NULL) link. + * Note that this can also occur when attempting to remove '.' + */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "can't delete self") + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL") /* Remove the link from the group */ if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) -- cgit v0.12 From 9876155d3fdb073dd3769f18665c86d04cda4806 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Mon, 27 Feb 2017 11:59:07 -0500 Subject: Updated the H5L.c error message after additional thought. Fix for HDFFV-10141. --- src/H5L.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/H5L.c b/src/H5L.c index f933e97..ecdf8a2 100644 --- a/src/H5L.c +++ b/src/H5L.c @@ -2355,7 +2355,7 @@ H5L_delete_cb(H5G_loc_t *grp_loc/*in*/, const char *name, const H5O_link_t *lnk, * Note that this can also occur when attempting to remove '.' */ if(lnk == NULL) - HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL") + HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "callback link pointer is NULL (specified link may be '.' or not exist)") /* Remove the link from the group */ if(H5G_obj_remove(grp_loc->oloc, grp_loc->path->full_path_r, name, udata->dxpl_id) < 0) -- cgit v0.12 From ad2963de609aa05fa45b525c0fde2f2641bd605e Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 5 Apr 2017 15:43:00 -0500 Subject: Modify test/fheap.c to run with various file space strategies and/or page buffering Modify test/fheap.c to run with different combinations of file space strategies and page buffering only when ExpressMode is 0 (HDF5TestExpress is 0). Tested on ostrich, platypus, mayll, emu, osx1010test, quail, kite, kituo. --- test/fheap.c | 669 ++++++++++++++++++++++++++++++++--------------------------- 1 file changed, 368 insertions(+), 301 deletions(-) diff --git a/test/fheap.c b/test/fheap.c index f08c0f8..77de4a8 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -81,6 +81,10 @@ #define DBLOCK_SIZE(fh, r) H5HF_get_dblock_size_test(fh, r) /* Size of a direct block in a given row */ #define DBLOCK_FREE(fh, r) H5HF_get_dblock_free_test(fh, r) /* Free space in a direct block of a given row */ +/* The number of settings for testing: page buffering, file space strategy and persisting free-space */ +#define NUM_PB_FS 6 +#define PAGE_BUFFER_PAGE_SIZE 4096 + const char *FILENAME[] = { "fheap", NULL @@ -16367,21 +16371,31 @@ main(void) fheap_test_param_t tparam; /* Testing parameters */ H5HF_create_t small_cparam; /* Creation parameters for "small" heap */ H5HF_create_t large_cparam; /* Creation parameters for "large" heap */ - hid_t fapl = -1; /* File access property list for data files */ - hid_t fcpl = -1; /* File creation property list for data files */ - hid_t fcpl2 = -1; /* File creation property list for data files */ + hid_t fapl = -1, def_fapl = -1; /* File access property list for data files */ + hid_t pb_fapl = -1; /* File access property list for data files */ + hid_t fcpl = -1, def_fcpl = -1; /* File creation property list for data files */ fheap_test_type_t curr_test; /* Current test being worked on */ - unsigned u; /* Local index variable */ + unsigned u, v; /* Local index variable */ unsigned nerrors = 0; /* Cumulative error count */ - int ExpressMode; /* Express testing level */ + unsigned num_pb_fs = 1; /* The number of settings to test for page buffering and file space handling */ + int ExpressMode; /* Express testing level */ /* Reset library */ h5_reset(); - fapl = h5_fileaccess(); + def_fapl = h5_fileaccess(); ExpressMode = GetTestExpress(); + + /* + * Caution when turning on ExpressMode 0: + * It will activate testing with different combinations of + * page buffering and file space strategy and the + * running time will be long. + */ if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + printf("***Express test mode on. Some tests may be skipped\n"); + else if(ExpressMode == 0) + num_pb_fs = NUM_PB_FS; /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); @@ -16392,359 +16406,409 @@ main(void) shared_wobj_g = (unsigned char *)H5MM_malloc(shared_obj_size_g); shared_robj_g = (unsigned char *)H5MM_malloc(shared_obj_size_g); - /* create a file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + /* Create a copy def_fapl and enable page buffering */ + if((pb_fapl = H5Pcopy(def_fapl)) < 0) + TEST_ERROR + if(H5Pset_page_buffer_size(pb_fapl, PAGE_BUFFER_PAGE_SIZE, 0, 0) < 0) TEST_ERROR - if((fcpl2 = H5Pcopy(fcpl)) < 0) TEST_ERROR - /* Set file space strategy and persisting free-space */ - /* This will be modified later on to run the test with different file space strategy setting */ - if(H5Pset_file_space_strategy(fcpl2, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1) < 0) + /* Create a file creation property list */ + if((def_fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) TEST_ERROR /* Initialize the shared write buffer for objects */ for(u = 0; u < shared_obj_size_g; u++) shared_wobj_g[u] = (unsigned char)u; - /* Iterate over the testing parameters */ - for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { - /* Clear the testing parameters */ - HDmemset(&tparam, 0, sizeof(fheap_test_param_t)); - tparam.actual_id_len = HEAP_ID_LEN; + for(v = 0; v < num_pb_fs; v++) { - /* This will be modified later on to run the test with different file space strategy setting */ - tparam.my_fcpl = fcpl2; + if((fcpl = H5Pcopy(def_fcpl)) < 0) + TEST_ERROR - /* Set appropriate testing parameters for each test */ - switch(curr_test) { - /* "Normal" testing parameters */ - case FHEAP_TEST_NORMAL: - puts("Testing with normal parameters"); + switch(v) { + case 0: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, FALSE, (hsize_t)1) < 0) + TEST_ERROR + fapl = def_fapl; break; - - /* "Re-open heap" testing parameters */ - case FHEAP_TEST_REOPEN: - puts("Testing with reopen heap flag set"); - tparam.reopen_heap = FHEAP_TEST_REOPEN; + case 1: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) + TEST_ERROR + fapl = def_fapl; + break; + case 2: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) + TEST_ERROR + fapl = def_fapl; + break; + case 3: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) + TEST_ERROR + fapl = def_fapl; + break; + case 4: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, FALSE, (hsize_t)1) < 0) + TEST_ERROR + fapl = pb_fapl; + break; + case 5: + if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_PAGE, TRUE, (hsize_t)1) < 0) + TEST_ERROR + fapl = pb_fapl; break; - /* An unknown test? */ - case FHEAP_TEST_NTESTS: + case NUM_PB_FS: default: goto error; - } /* end switch */ - - /* Test fractal heap creation */ - nerrors += test_create(fapl, &small_cparam, &tparam); - nerrors += test_reopen(fapl, &small_cparam, &tparam); - nerrors += test_open_twice(fapl, &small_cparam, &tparam); - nerrors += test_delete_open(fapl, &small_cparam, &tparam); + } - nerrors += test_id_limits(fapl, &small_cparam, tparam.my_fcpl); - nerrors += test_filtered_create(fapl, &small_cparam, tparam.my_fcpl); - nerrors += test_size(fapl, &small_cparam, tparam.my_fcpl); - nerrors += test_reopen_hdr(fapl, &small_cparam, tparam.my_fcpl); + /* Iterate over the testing parameters */ + for(curr_test = FHEAP_TEST_NORMAL; curr_test < FHEAP_TEST_NTESTS; H5_INC_ENUM(fheap_test_type_t, curr_test)) { + /* Clear the testing parameters */ + HDmemset(&tparam, 0, sizeof(fheap_test_param_t)); + tparam.actual_id_len = HEAP_ID_LEN; - { - fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */ - - /* Filling with different sized objects */ - for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { - tparam.fill = fill; + /* Set to run with different file space setting */ + tparam.my_fcpl = fcpl; /* Set appropriate testing parameters for each test */ - switch(fill) { - /* "Bulk fill" heap blocks with 'large' objects */ - case FHEAP_TEST_FILL_LARGE: - puts("Bulk-filling blocks w/large objects"); + switch(curr_test) { + /* "Normal" testing parameters */ + case FHEAP_TEST_NORMAL: + puts("Testing with normal parameters"); break; - /* "Bulk fill" heap blocks with 'single' objects */ - case FHEAP_TEST_FILL_SINGLE: - puts("Bulk-filling blocks w/single object"); + /* "Re-open heap" testing parameters */ + case FHEAP_TEST_REOPEN: + puts("Testing with reopen heap flag set"); + tparam.reopen_heap = FHEAP_TEST_REOPEN; break; /* An unknown test? */ - case FHEAP_TEST_FILL_N: + case FHEAP_TEST_NTESTS: default: goto error; } /* end switch */ - /* - * Test fractal heap managed object insertion - */ + /* Test fractal heap creation */ + nerrors += test_create(fapl, &small_cparam, &tparam); + nerrors += test_reopen(fapl, &small_cparam, &tparam); + nerrors += test_open_twice(fapl, &small_cparam, &tparam); + nerrors += test_delete_open(fapl, &small_cparam, &tparam); - /* "Weird" sized objects */ - nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam); + nerrors += test_id_limits(fapl, &small_cparam, tparam.my_fcpl); + nerrors += test_filtered_create(fapl, &small_cparam, tparam.my_fcpl); + nerrors += test_size(fapl, &small_cparam, tparam.my_fcpl); + nerrors += test_reopen_hdr(fapl, &small_cparam, tparam.my_fcpl); -#ifdef ALL_INSERT_TESTS - /* "Standard" sized objects, building from simple to complex heaps */ - nerrors += test_man_insert_first(fapl, &small_cparam, &tparam); - nerrors += test_man_insert_second(fapl, &small_cparam, &tparam); - nerrors += test_man_insert_root_mult(fapl, &small_cparam, &tparam); - nerrors += test_man_insert_force_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_insert_fill_second(fapl, &small_cparam, &tparam); - nerrors += test_man_insert_third_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_first_row(fapl, &small_cparam, &tparam); - nerrors += test_man_start_second_row(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_second_row(fapl, &small_cparam, &tparam); - nerrors += test_man_start_third_row(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_fourth_row(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_all_root_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_first_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_second_direct_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_first_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_second_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_second_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_recursive_indirect_row(fapl, &small_cparam, &tparam); - nerrors += test_man_start_2nd_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_recursive_indirect_two_deep(fapl, &small_cparam, &tparam); - nerrors += test_man_start_3rd_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_first_3rd_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_3rd_recursive_indirect_row(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_all_3rd_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_start_4th_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_first_4th_recursive_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_4th_recursive_indirect_row(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_all_4th_recursive_indirect(fapl, &small_cparam, &tparam); -#endif /* ALL_INSERT_TESTS */ - /* If this test fails, uncomment the tests above, which build up to this - * level of complexity gradually. -QAK - */ - if(ExpressMode > 1) - printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); - else - nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam); + { + fheap_test_fill_t fill; /* Size of objects to fill heap blocks with */ - /* - * Test fractal heap object deletion - */ - /* Simple removal */ - nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_REVERSE; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - 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); + /* Filling with different sized objects */ + for(fill = FHEAP_TEST_FILL_LARGE; fill < FHEAP_TEST_FILL_N; H5_INC_ENUM(fheap_test_fill_t, fill)) { + tparam.fill = fill; - { - fheap_test_del_dir_t del_dir; /* Deletion direction */ - fheap_test_del_drain_t drain_half; /* Deletion draining */ + /* Set appropriate testing parameters for each test */ + switch(fill) { + /* "Bulk fill" heap blocks with 'large' objects */ + case FHEAP_TEST_FILL_LARGE: + puts("Bulk-filling blocks w/large objects"); + break; - /* More complex removal patterns */ - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { - tparam.del_dir = del_dir; - for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { - tparam.drain_half = drain_half; - /* Don't need to test deletion directions when deleting entire heap */ - if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL) + /* "Bulk fill" heap blocks with 'single' objects */ + case FHEAP_TEST_FILL_SINGLE: + puts("Bulk-filling blocks w/single object"); break; - /* Simple insertion patterns */ - nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_first_row(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam); - if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); - else { - nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam); - } /* end else */ - - /* Skip blocks insertion */ - /* (covers insertion & deletion of skipped blocks) */ - nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam); - nerrors += test_man_skip_start_block_add_back(fapl, &small_cparam, &tparam); - nerrors += test_man_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_skip_2nd_block(fapl, &small_cparam, &tparam); - nerrors += test_man_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_one_partial_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_row_skip_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_skip_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_direct_skip_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_2nd_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); - if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); - else { - nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); - nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); - } /* end else */ - - /* Fragmented insertion patterns */ - /* (covers insertion & deletion of fragmented blocks) */ - nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam); - nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam); - nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam); + /* An unknown test? */ + case FHEAP_TEST_FILL_N: + default: + goto error; + } /* end switch */ + + /* + * Test fractal heap managed object insertion + */ + + /* "Weird" sized objects */ + nerrors += test_man_insert_weird(fapl, &small_cparam, &tparam); + +#ifdef ALL_INSERT_TESTS + /* "Standard" sized objects, building from simple to complex heaps */ + nerrors += test_man_insert_first(fapl, &small_cparam, &tparam); + nerrors += test_man_insert_second(fapl, &small_cparam, &tparam); + nerrors += test_man_insert_root_mult(fapl, &small_cparam, &tparam); + nerrors += test_man_insert_force_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_insert_fill_second(fapl, &small_cparam, &tparam); + nerrors += test_man_insert_third_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_first_row(fapl, &small_cparam, &tparam); + nerrors += test_man_start_second_row(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_second_row(fapl, &small_cparam, &tparam); + nerrors += test_man_start_third_row(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_fourth_row(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_all_root_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_first_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_second_direct_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_first_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_second_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_second_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_recursive_indirect_row(fapl, &small_cparam, &tparam); + nerrors += test_man_start_2nd_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_recursive_indirect_two_deep(fapl, &small_cparam, &tparam); + nerrors += test_man_start_3rd_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_first_3rd_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_3rd_recursive_indirect_row(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_all_3rd_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_start_4th_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_first_4th_recursive_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_4th_recursive_indirect_row(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_all_4th_recursive_indirect(fapl, &small_cparam, &tparam); +#endif /* ALL_INSERT_TESTS */ + /* If this test fails, uncomment the tests above, which build up to this + * level of complexity gradually. -QAK + */ + if(ExpressMode > 1) + printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); + else + nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam); + + /* + * Test fractal heap object deletion + */ + /* Simple removal */ + nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_REVERSE; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + 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); + + { + fheap_test_del_dir_t del_dir; /* Deletion direction */ + fheap_test_del_drain_t drain_half; /* Deletion draining */ + + /* More complex removal patterns */ + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { + tparam.del_dir = del_dir; + for(drain_half = FHEAP_DEL_DRAIN_ALL; drain_half < FHEAP_DEL_DRAIN_N; H5_INC_ENUM(fheap_test_del_drain_t, drain_half)) { + tparam.drain_half = drain_half; + /* Don't need to test deletion directions when deleting entire heap */ + if(tparam.del_dir == FHEAP_DEL_HEAP && tparam.drain_half > FHEAP_DEL_DRAIN_ALL) + break; + + /* Simple insertion patterns */ + nerrors += test_man_remove_root_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_two_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_first_row(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam); + if(ExpressMode > 1) + printf("***Express test mode on. Some tests skipped\n"); + else { + nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_3rd_indirect(fapl, &small_cparam, &tparam); + } /* end else */ + + /* Skip blocks insertion */ + /* (covers insertion & deletion of skipped blocks) */ + nerrors += test_man_skip_start_block(fapl, &small_cparam, &tparam); + nerrors += test_man_skip_start_block_add_back(fapl, &small_cparam, &tparam); + nerrors += test_man_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_skip_2nd_block(fapl, &small_cparam, &tparam); + nerrors += test_man_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_one_partial_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_row_skip_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_skip_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_direct_skip_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_direct_skip_2nd_indirect_skip_2nd_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_direct_skip_indirect_two_rows_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_direct_skip_indirect_two_rows_skip_indirect_row_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_2nd_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_2nd_direct_skip_2nd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_2nd_direct_fill_direct_skip2_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); + if(ExpressMode > 1) + printf("***Express test mode on. Some tests skipped\n"); + else { + nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_two_rows_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); + nerrors += test_man_fill_4th_direct_less_one_fill_2nd_direct_fill_direct_skip_3rd_indirect_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); + } /* end else */ + + /* Fragmented insertion patterns */ + /* (covers insertion & deletion of fragmented blocks) */ + nerrors += test_man_frag_simple(fapl, &small_cparam, &tparam); + nerrors += test_man_frag_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_frag_2nd_direct(fapl, &small_cparam, &tparam); + nerrors += test_man_frag_3rd_direct(fapl, &small_cparam, &tparam); + } /* end for */ } /* end for */ - } /* end for */ - /* Reset deletion drain parameter */ - tparam.drain_half = FHEAP_DEL_DRAIN_ALL; + /* Reset deletion drain parameter */ + tparam.drain_half = FHEAP_DEL_DRAIN_ALL; - } /* end block */ + } /* end block */ } /* end for */ - } /* end block */ + } /* end block */ - /* - * Test fractal heap 'huge' & 'tiny' object insertion & deletion - */ - { - fheap_test_del_dir_t del_dir; /* Deletion direction */ - unsigned id_len; /* Length of heap IDs */ - - /* Test "normal" & "direct" storage of 'huge' & 'tiny' heap IDs */ - for(id_len = 0; id_len < 3; id_len++) { - /* Set the ID length for this test */ - small_cparam.id_len = (uint16_t)id_len; - - /* Print information about each test */ - switch(id_len) { - /* Use "normal" form for 'huge' object's heap IDs */ - case 0: - puts("Using 'normal' heap ID format for 'huge' objects"); - break; + /* + * Test fractal heap 'huge' & 'tiny' object insertion & deletion + */ + { + fheap_test_del_dir_t del_dir; /* Deletion direction */ + unsigned id_len; /* Length of heap IDs */ + + /* Test "normal" & "direct" storage of 'huge' & 'tiny' heap IDs */ + for(id_len = 0; id_len < 3; id_len++) { + /* Set the ID length for this test */ + small_cparam.id_len = (uint16_t)id_len; + + /* Print information about each test */ + switch(id_len) { + /* Use "normal" form for 'huge' object's heap IDs */ + case 0: + puts("Using 'normal' heap ID format for 'huge' objects"); + break; - /* Use "direct" form for 'huge' object's heap IDs */ - case 1: - puts("Using 'direct' heap ID format for 'huge' objects"); + /* Use "direct" form for 'huge' object's heap IDs */ + case 1: + puts("Using 'direct' heap ID format for 'huge' objects"); - /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */ - tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */ - break; + /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */ + tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */ + break; - /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */ - case 2: - small_cparam.id_len = 37; - puts("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); - tparam.actual_id_len = 37; - break; + /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */ + case 2: + small_cparam.id_len = 37; + puts("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); + tparam.actual_id_len = 37; + break; - /* An unknown test? */ - default: - goto error; - } /* end switch */ + /* An unknown test? */ + default: + goto error; + } /* end switch */ + + /* Try several different methods of deleting objects */ + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { + tparam.del_dir = del_dir; + + /* Test 'huge' object insert & delete */ + nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam); + nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam); + nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam); + nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam); + nerrors += test_filtered_huge(fapl, &small_cparam, &tparam); + + /* Test 'tiny' object insert & delete */ + nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam); + nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam); + nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam); + } /* end for */ + } /* end for */ + + /* Reset the "normal" heap ID lengths */ + small_cparam.id_len = 0; + tparam.actual_id_len = HEAP_ID_LEN; + } /* end block */ + + /* Test I/O filter support */ /* Try several different methods of deleting objects */ + { + fheap_test_del_dir_t del_dir; /* Deletion direction */ + for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { tparam.del_dir = del_dir; - /* Test 'huge' object insert & delete */ - nerrors += test_huge_insert_one(fapl, &small_cparam, &tparam); - nerrors += test_huge_insert_two(fapl, &small_cparam, &tparam); - nerrors += test_huge_insert_three(fapl, &small_cparam, &tparam); - nerrors += test_huge_insert_mix(fapl, &small_cparam, &tparam); - nerrors += test_filtered_huge(fapl, &small_cparam, &tparam); - - /* Test 'tiny' object insert & delete */ - nerrors += test_tiny_insert_one(fapl, &small_cparam, &tparam); - nerrors += test_tiny_insert_two(fapl, &small_cparam, &tparam); - nerrors += test_tiny_insert_mix(fapl, &small_cparam, &tparam); + /* Controlled tests */ + /* XXX: Re-enable file size checks in these tests, after the file has persistent free space tracking working */ + nerrors += test_filtered_man_root_direct(fapl, &small_cparam, &tparam); + nerrors += test_filtered_man_root_indirect(fapl, &small_cparam, &tparam); + + /* Random tests, with compressed blocks */ + tparam.comp = FHEAP_TEST_COMPRESS; + nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(25*1000*1000)), fapl, &small_cparam, &tparam); + nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(2*1000*1000)), fapl, &small_cparam, &tparam); + + /* Reset block compression */ + tparam.comp = FHEAP_TEST_NO_COMPRESS; } /* end for */ - } /* end for */ + } /* end block */ + + /* Random object insertion & deletion */ + if(ExpressMode > 1) + printf("***Express test mode on. Some tests skipped\n"); + else { + /* Random tests using "small" heap creation parameters */ + puts("Using 'small' heap creation parameters"); + + /* (reduce size of tests when re-opening each time) */ + /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); + nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); + + tparam.del_dir = FHEAP_DEL_HEAP; + nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); + nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); - /* Reset the "normal" heap ID lengths */ - small_cparam.id_len = 0; - tparam.actual_id_len = HEAP_ID_LEN; - } /* end block */ + /* Random tests using "large" heap creation parameters */ + puts("Using 'large' heap creation parameters"); + tparam.actual_id_len = LARGE_HEAP_ID_LEN; - /* Test I/O filter support */ + /* (reduce size of tests when re-opening each time) */ + /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); + nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); - /* Try several different methods of deleting objects */ - { - fheap_test_del_dir_t del_dir; /* Deletion direction */ + tparam.del_dir = FHEAP_DEL_HEAP; + nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); + nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); - for(del_dir = FHEAP_DEL_FORWARD; del_dir < FHEAP_DEL_NDIRS; H5_INC_ENUM(fheap_test_del_dir_t, del_dir)) { - tparam.del_dir = del_dir; + /* Reset the "normal" heap ID length */ + tparam.actual_id_len = SMALL_HEAP_ID_LEN; + } /* end else */ - /* Controlled tests */ -/* XXX: Re-enable file size checks in these tests, after the file has persistent free space tracking working */ - nerrors += test_filtered_man_root_direct(fapl, &small_cparam, &tparam); - nerrors += test_filtered_man_root_indirect(fapl, &small_cparam, &tparam); + /* Test object writing support */ - /* Random tests, with compressed blocks */ + /* Basic object writing */ + nerrors += test_write(fapl, &small_cparam, &tparam); + + /* Writing objects in heap with filters */ tparam.comp = FHEAP_TEST_COMPRESS; - nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(25*1000*1000)), fapl, &small_cparam, &tparam); - nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(50*1000*1000) : (hsize_t)(2*1000*1000)), fapl, &small_cparam, &tparam); + nerrors += test_write(fapl, &small_cparam, &tparam); /* Reset block compression */ tparam.comp = FHEAP_TEST_NO_COMPRESS; } /* end for */ - } /* end block */ - - /* Random object insertion & deletion */ - if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); - else { - /* Random tests using "small" heap creation parameters */ - puts("Using 'small' heap creation parameters"); - - /* (reduce size of tests when re-opening each time) */ -/* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); - nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); - - tparam.del_dir = FHEAP_DEL_HEAP; - nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &small_cparam, &tparam); - nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); - - /* Random tests using "large" heap creation parameters */ - puts("Using 'large' heap creation parameters"); - tparam.actual_id_len = LARGE_HEAP_ID_LEN; - - /* (reduce size of tests when re-opening each time) */ -/* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); - nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); - - tparam.del_dir = FHEAP_DEL_HEAP; - nerrors += test_random((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(50*1000*1000)), fapl, &large_cparam, &tparam); - nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &large_cparam, &tparam); - - /* Reset the "normal" heap ID length */ - tparam.actual_id_len = SMALL_HEAP_ID_LEN; - } /* end else */ - - /* Test object writing support */ - /* Basic object writing */ - nerrors += test_write(fapl, &small_cparam, &tparam); - - /* Writing objects in heap with filters */ - tparam.comp = FHEAP_TEST_COMPRESS; - nerrors += test_write(fapl, &small_cparam, &tparam); + if(H5Pclose(fcpl) < 0) + TEST_ERROR + } /* end num_pb_fs */ - /* Reset block compression */ - tparam.comp = FHEAP_TEST_NO_COMPRESS; - } /* end for */ + /* Tests that address specific bugs */ + tparam.my_fcpl = def_fcpl; + fapl = def_fapl; /* Tests that address specific bugs */ nerrors += test_bug1(fapl, &small_cparam, &tparam); @@ -16763,12 +16827,12 @@ main(void) H5MM_xfree(shared_lens_g); H5MM_xfree(shared_offs_g); - if(H5Pclose(fcpl) < 0) TEST_ERROR - if(H5Pclose(fcpl2) < 0) TEST_ERROR + if(H5Pclose(def_fcpl) < 0) TEST_ERROR + if(H5Pclose(pb_fapl) < 0) TEST_ERROR /* Clean up file used */ #ifndef QAK - h5_cleanup(FILENAME, fapl); + h5_cleanup(FILENAME, def_fapl); #else /* QAK */ HDfprintf(stderr, "Uncomment cleanup!\n"); #endif /* QAK */ @@ -16783,7 +16847,10 @@ error: H5MM_xfree(shared_ids_g); H5MM_xfree(shared_lens_g); H5MM_xfree(shared_offs_g); - H5Pclose(fapl); + H5Pclose(def_fapl); + H5Pclose(pb_fapl); + H5Pclose(def_fcpl); + H5Pclose(fcpl); } H5E_END_TRY; return 1; } /* end main() */ -- cgit v0.12 From f1ad2feb0b253302895a0bc9835ade8f2f2484e8 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 6 Apr 2017 11:22:29 -0500 Subject: Fix CMake regex commands --- CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11c9b53..ce91052 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,7 +281,7 @@ if (H5_TOOLS_SOVERS_EXISTS) math (EXPR H5_TOOLS_SOVERS_MAJOR ${H5_TOOLS_SOVERS_INTERFACE}-${H5_TOOLS_SOVERS_RELEASE}) message (STATUS "SOVERSION_TOOLS: ${H5_TOOLS_SOVERS_MAJOR}.${H5_TOOLS_SOVERS_RELEASE}.${H5_TOOLS_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -292,7 +292,7 @@ if (H5_CXX_SOVERS_EXISTS) math (EXPR H5_CXX_SOVERS_MAJOR ${H5_CXX_SOVERS_INTERFACE}-${H5_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_CXX: ${H5_CXX_SOVERS_MAJOR}.${H5_CXX_SOVERS_RELEASE}.${H5_CXX_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -303,7 +303,7 @@ if (H5_F_SOVERS_EXISTS) math (EXPR H5_F_SOVERS_MAJOR ${H5_F_SOVERS_INTERFACE}-${H5_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_F: ${H5_F_SOVERS_MAJOR}.${H5_F_SOVERS_RELEASE}.${H5_F_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -314,7 +314,7 @@ if (H5_HL_SOVERS_EXISTS) math (EXPR H5_HL_SOVERS_MAJOR ${H5_HL_SOVERS_INTERFACE}-${H5_HL_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL: ${H5_HL_SOVERS_MAJOR}.${H5_HL_SOVERS_RELEASE}.${H5_HL_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_CXX_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_CXX_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_CXX_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_CXX_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -325,7 +325,7 @@ if (H5_HL_CXX_SOVERS_EXISTS) math (EXPR H5_HL_CXX_SOVERS_MAJOR ${H5_HL_CXX_SOVERS_INTERFACE}-${H5_HL_CXX_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_CXX: ${H5_HL_CXX_SOVERS_MAJOR}.${H5_HL_CXX_SOVERS_RELEASE}.${H5_HL_CXX_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_HL_F_SOVERS_EXISTS ${_lt_vers_am_contents}) if (H5_HL_F_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_HL_F_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_HL_F_SOVERS_INTERFACE ${_lt_vers_am_contents}) @@ -336,7 +336,7 @@ if (H5_HL_F_SOVERS_EXISTS) math (EXPR H5_HL_F_SOVERS_MAJOR ${H5_HL_F_SOVERS_INTERFACE}-${H5_HL_F_SOVERS_RELEASE}) message (STATUS "SOVERSION_HL_F: ${H5_HL_F_SOVERS_MAJOR}.${H5_HL_F_SOVERS_RELEASE}.${H5_HL_F_SOVERS_MINOR}") endif () -string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) +string (REGEX MATCH ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" H5_JAVA_SOVERS_EXISTS ${_lt_vers_am_contents}) if(H5_JAVA_SOVERS_EXISTS) string (REGEX REPLACE ".*LT_JAVA_VERS_INTERFACE[ \t]+=[ \t]+([0-9]*).*$" "\\1" H5_JAVA_SOVERS_INTERFACE ${_lt_vers_am_contents}) -- cgit v0.12 From 177a8ba30eb14edd70fb941895c800506318ec8a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 6 Apr 2017 14:29:47 -0500 Subject: Add missing test status --- test/plugin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/test/plugin.c b/test/plugin.c index 041f702..2939595 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -774,6 +774,7 @@ test_filter_path_apis(void) ret = H5PLappend(pathname); } H5E_END_TRY if(ret >= 0) TEST_ERROR + PASSED(); TESTING(" remove (exceed max)"); /* Exceed the max path removal */ -- cgit v0.12 From 4b11c4fd518026667944b50b4cd4cb41bec7e25a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 6 Apr 2017 15:00:48 -0500 Subject: HDFFV-10143 add missing javadoc param --- java/src/hdf/hdf5lib/H5.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 88bd0e5..0c11846 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -7229,6 +7229,8 @@ public class H5 implements java.io.Serializable { * * @param plugin_path * IN: Path for location of filter plugin libraries. + * @param index + * IN: The table index (0-based). * * @exception HDF5LibraryException * - Error from the HDF-5 Library. @@ -7240,6 +7242,8 @@ public class H5 implements java.io.Serializable { * * @param plugin_path * IN: Path for location of filter plugin libraries. + * @param index + * IN: The table index (0-based). * * @exception HDF5LibraryException * - Error from the HDF-5 Library. @@ -7249,6 +7253,9 @@ public class H5 implements java.io.Serializable { /** * H5PLremove removes the plugin path at the specified index. * + * @param index + * IN: The table index (0-based). + * * @exception HDF5LibraryException * - Error from the HDF-5 Library. **/ @@ -7257,6 +7264,9 @@ public class H5 implements java.io.Serializable { /** * H5PLget retrieves the plugin path at the specified index. * + * @param index + * IN: The table index (0-based). + * * @return the current path at the index in plugin path table * * @exception HDF5LibraryException -- cgit v0.12 From 94c34773ceae5b30c4afb227d0385ebf4ab6ce28 Mon Sep 17 00:00:00 2001 From: mainzer Date: Thu, 6 Apr 2017 18:11:21 -0500 Subject: Checkin of fix for CGNS bug (https://jira.hdfgroup.org/browse/HDFFV-10055). Briefly, in H5C_collective_write() in H5Cmpio.c, the metadata cache attempts to perform a collective write of metadata cache entries. This worked fine as long as all processes had at least one entry to write. However, when the process has no entries, the function tries to participate in the collective write by calling MPI_File_set_view(), MPI_File_write_all() and then MPI_File_set_view() again, to match the calls in H5FD_mpio_write(). After pull request 183, the CGNS test benchmark_hdf5 started failing. On investigation, I determined that the failure occurred in the first call to MPI_File_set_view() in the "no data to write" path through H5C_collective_write(). Note that pull request 183 did not create the problem, it only exposed it. The bug can be observed after pull request 182 if one executes the CGNS progam src/ptests/benchmark_hdf5 with 90 processes. The problem appears to have been that the calls to MPI_File_set_view() in H5C_collective_write() and H5FD_mpio_write() were using different values for the info parameter. I patched the problem by adding a MPI specific VFD call allowing me to get the MPI_Info used in H5FD_mpio_write() for use in MPI_File_set_view() calls in H5C_collective_write(). Tested serial & parallel, debug & production on Jelly. --- src/H5Cdbg.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++- src/H5Cmpio.c | 102 ++++++++++++++++++++++++++++++++++++++----------- src/H5Cprivate.h | 5 ++- src/H5FDmpi.c | 39 +++++++++++++++++++ src/H5FDmpio.c | 37 +++++++++++++++++- src/H5FDprivate.h | 2 + src/H5Fmpi.c | 26 +++++++++++++ src/H5Fprivate.h | 1 + 8 files changed, 298 insertions(+), 26 deletions(-) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 0a98406..455b653 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -30,12 +30,16 @@ #include "H5Cmodule.h" /* This source code file is part of the H5C module */ +#define H5AC_FRIEND + + + /***********/ /* Headers */ /***********/ #include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata Cache */ +#include "H5ACpkg.h" /* Metadata Cache */ #include "H5Cpkg.h" /* Cache */ #include "H5Eprivate.h" /* Error Handling */ @@ -340,6 +344,112 @@ H5C_dump_cache_skip_list(H5C_t * cache_ptr, char * calling_fcn) /*------------------------------------------------------------------------- + * Function: H5C_dump_coll_write_list + * + * Purpose: Debugging routine that prints a summary of the contents of + * the collective write skip list used by the metadata cache + * in the parallel case to maintain a list of entries to write + * collectively at a sync point. + * + * Return: Non-negative on success/Negative on failure + * + * Programmer: John Mainzer + * 4/1/17 + * + *------------------------------------------------------------------------- + */ +#ifdef H5_HAVE_PARALLEL +#ifndef NDEBUG +herr_t +H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) +{ + herr_t ret_value = SUCCEED; /* Return value */ + int i; + int list_len; + H5AC_aux_t * aux_ptr = NULL; + H5C_cache_entry_t * entry_ptr = NULL; + H5SL_node_t * node_ptr = NULL; + + FUNC_ENTER_NOAPI_NOERR + + HDassert(cache_ptr != NULL); + HDassert(cache_ptr->magic == H5C__H5C_T_MAGIC); + HDassert(cache_ptr->aux_ptr); + + aux_ptr = (H5AC_aux_t *)cache_ptr->aux_ptr; + + HDassert(aux_ptr->magic == H5AC__H5AC_AUX_T_MAGIC); + + HDassert(calling_fcn != NULL); + + list_len = (int)H5SL_count(cache_ptr->coll_write_list); + + HDfprintf(stdout, "\n\nDumping MDC coll write list from %d:%s.\n", + aux_ptr->mpi_rank, calling_fcn); + HDfprintf(stdout, " slist len = %u.\n", cache_ptr->slist_len); + + if ( list_len > 0 ) { + + /* scan the collective write list generating the desired output */ + HDfprintf(stdout, + "Num: Addr: Len: Prot/Pind: Dirty: Type:\n"); + + i = 0; + + node_ptr = H5SL_first(cache_ptr->coll_write_list); + + if ( node_ptr != NULL ) + + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + else + + entry_ptr = NULL; + + while ( entry_ptr != NULL ) { + + HDassert(entry_ptr->magic == H5C__H5C_CACHE_ENTRY_T_MAGIC); + + HDfprintf(stdout, + "%s%d 0x%016llx %4lld %d/%d %d %s\n", + cache_ptr->prefix, i, + (long long)(entry_ptr->addr), + (long long)(entry_ptr->size), + (int)(entry_ptr->is_protected), + (int)(entry_ptr->is_pinned), + (int)(entry_ptr->is_dirty), + entry_ptr->type->name); + + /* HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", + (unsigned long long)node_ptr, + H5SL_item(node_ptr)); + */ + + node_ptr = H5SL_next(node_ptr); + + if ( node_ptr != NULL ) + + entry_ptr = (H5C_cache_entry_t *)H5SL_item(node_ptr); + + else + + entry_ptr = NULL; + + i++; + + } /* end while */ + } /* end if */ + + HDfprintf(stdout, "\n\n"); + + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5C_dump_coll_write_list() */ +#endif /* NDEBUG */ +#endif /* H5_HAVE_PARALLEL */ + + +/*------------------------------------------------------------------------- * Function: H5C_set_prefix * * Purpose: Set the values of the prefix field of H5C_t. This diff --git a/src/H5Cmpio.c b/src/H5Cmpio.c index 06ce714..0d1a3ff 100644 --- a/src/H5Cmpio.c +++ b/src/H5Cmpio.c @@ -950,12 +950,15 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) /* Get original transfer mode */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data transfer property list") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, \ + "not a data transfer property list") + if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") /* Get number of entries in collective write list */ count = (int)H5SL_count(cache_ptr->coll_write_list); + if(count > 0) { H5FD_mpio_xfer_t xfer_mode = H5FD_MPIO_COLLECTIVE; H5SL_node_t *node; @@ -964,21 +967,34 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) int i; if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ + "can't set MPI-I/O property") /* Allocate arrays */ - if(NULL == (length_array = (int *)H5MM_malloc((size_t)count * sizeof(int)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective write table length array") - if(NULL == (buf_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective buf table length array") - if(NULL == (offset_array = (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint)))) - HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "memory allocation failed for collective offset table length array") + if ( NULL == (length_array = + (int *)H5MM_malloc((size_t)count * sizeof(int))) ) + + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for collective write table length array") + + if ( NULL == (buf_array = + (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for collective buf table length array") + + if(NULL == (offset_array = + (MPI_Aint *)H5MM_malloc((size_t)count * sizeof(MPI_Aint))) ) + + HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, \ + "memory allocation failed for collective offset table length array") /* Fill arrays */ node = H5SL_first(cache_ptr->coll_write_list); HDassert(node); if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ + "can't retrieve skip list item") /* Set up initial array position & buffer base address */ length_array[0] = (int)entry_ptr->size; @@ -989,8 +1005,10 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) node = H5SL_next(node); i = 1; while(node) { + if(NULL == (entry_ptr = (H5C_cache_entry_t *)H5SL_item(node))) - HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, "can't retrieve skip list item") + HGOTO_ERROR(H5E_CACHE, H5E_NOTFOUND, FAIL, \ + "can't retrieve skip list item") /* Set up array position */ length_array[i] = (int)entry_ptr->size; @@ -1003,48 +1021,85 @@ H5C__collective_write(H5F_t *f, hid_t dxpl_id) } /* end while */ /* Create memory MPI type */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, buf_array, MPI_BYTE, &btype))) + if(MPI_SUCCESS != (mpi_code = + MPI_Type_create_hindexed(count, length_array, + buf_array, MPI_BYTE, + &btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + btype_created = TRUE; + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&btype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Create file MPI type */ - if(MPI_SUCCESS != (mpi_code = MPI_Type_create_hindexed(count, length_array, offset_array, MPI_BYTE, &ftype))) + if(MPI_SUCCESS != (mpi_code = + MPI_Type_create_hindexed(count, length_array, + offset_array, MPI_BYTE, + &ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_create_hindexed failed", mpi_code) + ftype_created = TRUE; + if(MPI_SUCCESS != (mpi_code = MPI_Type_commit(&ftype))) HMPI_GOTO_ERROR(FAIL, "MPI_Type_commit failed", mpi_code) /* Pass buf type, file type to the file driver */ if(H5FD_mpi_setup_collective(dxpl_id, &btype, &ftype) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties") + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ + "can't set MPI-I/O properties") /* Write data */ - if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, (size_t)1, dxpl_id, base_buf) < 0) - HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to write entries collectively") + if(H5F_block_write(f, H5FD_MEM_DEFAULT, (haddr_t)0, + (size_t)1, dxpl_id, base_buf) < 0) + HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, \ + "unable to write entries collectively") + } /* end if */ else { MPI_Status mpi_stat; - MPI_File mpi_fh_p; + MPI_File *mpi_fh_p; MPI_File mpi_fh; + MPI_Info *info_p; + MPI_Info info; if(H5F_get_mpi_handle(f, (MPI_File **)&mpi_fh_p) < 0) - HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file handle") + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ + "can't get mpi file handle") + mpi_fh = *(MPI_File*)mpi_fh_p; - /* just to match up with the 1st MPI_File_set_view from H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) + if (H5F_get_mpi_info(f, &info_p) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, \ + "can't get mpi file info") + + info = *info_p; + + /* just to match up with the 1st MPI_File_set_view from + * H5FD_mpio_write() + */ + if(MPI_SUCCESS != (mpi_code = + MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, + MPI_BYTE, "native", + info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) /* just to match up with MPI_File_write_at_all from H5FD_mpio_write() */ HDmemset(&mpi_stat, 0, sizeof(MPI_Status)); - if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, NULL, 0, MPI_BYTE, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = + MPI_File_write_at_all(mpi_fh, (MPI_Offset)0, + NULL, 0, MPI_BYTE, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) - /* just to match up with the 2nd MPI_File_set_view (reset) in H5FD_mpio_write() */ - if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, "native", MPI_INFO_NULL))) + /* just to match up with the 2nd MPI_File_set_view (reset) in + * H5FD_mpio_write() + */ + if(MPI_SUCCESS != (mpi_code = + MPI_File_set_view(mpi_fh, (MPI_Offset)0, MPI_BYTE, + MPI_BYTE, "native", + info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) + } /* end else */ done: @@ -1063,7 +1118,8 @@ done: if(orig_xfer_mode != H5FD_MPIO_COLLECTIVE) { HDassert(plist); if(H5P_set(plist, H5D_XFER_IO_XFER_MODE_NAME, &orig_xfer_mode) < 0) - HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O property") + HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ + "can't set MPI-I/O property") } /* end if */ FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index bdfb23e..5c5a666 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -2340,9 +2340,12 @@ H5_DLL herr_t H5C_dump_cache_LRU(H5C_t *cache_ptr, const char *cache_name); H5_DLL hbool_t H5C_get_serialization_in_progress(const H5C_t *cache_ptr); H5_DLL hbool_t H5C_cache_is_clean(const H5C_t *cache_ptr, H5C_ring_t inner_ring); H5_DLL herr_t H5C_dump_cache_skip_list(H5C_t *cache_ptr, char *calling_fcn); +#ifdef H5_HAVE_PARALLEL +H5_DLL herr_t H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn); +#endif /* H5_HAVE_PARALLEL */ H5_DLL herr_t H5C_get_entry_ptr_from_addr(H5C_t *cache_ptr, haddr_t addr, void **entry_ptr_ptr); -H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, +H5_DLL herr_t H5C_flush_dependency_exists(H5C_t *cache_ptr, haddr_t parent_addr, haddr_t child_addr, hbool_t *fd_exists_ptr); H5_DLL herr_t H5C_verify_entry_type(H5C_t *cache_ptr, haddr_t addr, const H5C_class_t *expected_type, hbool_t *in_cache_ptr, diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index fdc4eca..bf4e03a 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -148,6 +148,45 @@ done: /*------------------------------------------------------------------------- + * Function: H5FD_get_mpi_info + * + * Purpose: Retrieves the file's mpi info + * + * Return: Success: SUCCEED + * + * Failure: Negative + * + * Programmer: John Mainzer + * 4/4/17 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +herr_t +H5FD_get_mpi_info(H5FD_t *file, void** mpi_info) +{ + const H5FD_class_mpi_t *cls; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + HDassert(file); + cls = (const H5FD_class_mpi_t *)(file->cls); + HDassert(cls); + HDassert(cls->get_mpi_info); /* All MPI drivers must implement this */ + + /* Dispatch to driver */ + if ((ret_value=(cls->get_mpi_info)(file, mpi_info)) < 0) + HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, \ + "driver get_mpi_info request failed") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5FD_get_mpi_info() */ + + +/*------------------------------------------------------------------------- * Function: H5FD_mpi_MPIOff_to_haddr * * Purpose: Convert an MPI_Offset value to haddr_t. diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index a3a404f..9417d46 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -95,6 +95,7 @@ static herr_t H5FD_mpio_truncate(H5FD_t *_file, hid_t dxpl_id, hbool_t closing); static int H5FD_mpio_mpi_rank(const H5FD_t *_file); static int H5FD_mpio_mpi_size(const H5FD_t *_file); static MPI_Comm H5FD_mpio_communicator(const H5FD_t *_file); +static herr_t H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info); /* The MPIO file driver information */ static const H5FD_class_mpi_t H5FD_mpio_g = { @@ -134,7 +135,8 @@ static const H5FD_class_mpi_t H5FD_mpio_g = { }, /* End of superclass information */ H5FD_mpio_mpi_rank, /*get_rank */ H5FD_mpio_mpi_size, /*get_size */ - H5FD_mpio_communicator /*get_comm */ + H5FD_mpio_communicator, /*get_comm */ + H5FD_mpio_get_info /*get_info */ }; #ifdef H5FDmpio_DEBUG @@ -1308,6 +1310,39 @@ done: /*------------------------------------------------------------------------- + * Function: H5FD_mpio_get_info + * + * Purpose: Returns the file info of MPIO file driver. + * + * Returns: Non-negative if succeed or negative if fails. + * + * Programmer: John Mainzer + * April 4, 2017 + * + * Modifications: + * + *------------------------------------------------------------------------- +*/ +static herr_t +H5FD_mpio_get_info(H5FD_t *_file, void** mpi_info) +{ + H5FD_mpio_t *file = (H5FD_mpio_t *)_file; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI_NOINIT + + if(!mpi_info) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mpi info not valid") + + *mpi_info = &(file->info); + +done: + FUNC_LEAVE_NOAPI(ret_value) + +} /* H5FD_mpio_get_info() */ + + +/*------------------------------------------------------------------------- * Function: H5FD_mpio_read * * Purpose: Reads SIZE bytes of data from FILE beginning at address ADDR diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index c64ec30..fb7c43c 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -53,6 +53,7 @@ typedef struct H5FD_class_mpi_t { int (*get_rank)(const H5FD_t *file); /* Get the MPI rank of a process */ int (*get_size)(const H5FD_t *file); /* Get the MPI size of a communicator */ MPI_Comm (*get_comm)(const H5FD_t *file); /* Get the communicator for a file */ + herr_t (*get_mpi_info)(H5FD_t *file, void** mpi_info); /* get MPI_Info for a file */ } H5FD_class_mpi_t; #endif @@ -202,6 +203,7 @@ H5_DLL herr_t H5FD_get_mpio_atomicity(H5FD_t *file, hbool_t *flag); H5_DLL int H5FD_mpi_get_rank(const H5FD_t *file); H5_DLL int H5FD_mpi_get_size(const H5FD_t *file); H5_DLL MPI_Comm H5FD_mpi_get_comm(const H5FD_t *_file); +H5_DLL herr_t H5FD_get_mpi_info(H5FD_t *file, void** file_info); #endif /* H5_HAVE_PARALLEL */ #endif /* !_H5FDprivate_H */ diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 5434aa5..60593a8 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -356,5 +356,31 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_mpi_retrieve_comm */ +/*------------------------------------------------------------------------- + * Function: H5F_get_mpi_info + * + * Purpose: Retrieves MPI File info. + * + * Return: Success: The size (positive) + * Failure: Negative + * + *------------------------------------------------------------------------- + */ +herr_t +H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info) +{ + herr_t ret_value = SUCCEED; + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(f && f->shared); + + /* Dispatch to driver */ + if ((ret_value = H5FD_get_mpi_info(f->shared->lf, (void **)f_info)) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "can't get mpi file info") + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5F_get_mpi_info() */ #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 886063a..8ef353a 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -852,6 +852,7 @@ H5_DLL int H5F_mpi_get_rank(const H5F_t *f); H5_DLL MPI_Comm H5F_mpi_get_comm(const H5F_t *f); H5_DLL int H5F_mpi_get_size(const H5F_t *f); H5_DLL herr_t H5F_mpi_retrieve_comm(hid_t loc_id, hid_t acspl_id, MPI_Comm *mpi_comm); +H5_DLL herr_t H5F_get_mpi_info(const H5F_t *f, MPI_Info **f_info); #endif /* H5_HAVE_PARALLEL */ /* External file cache routines */ -- cgit v0.12 From eb75dc1bb02e13902d73a36caafe763eea585d02 Mon Sep 17 00:00:00 2001 From: mainzer Date: Fri, 7 Apr 2017 13:17:08 -0500 Subject: Removed commeted out code from H5C_dump_coll_write_list() --- src/H5Cdbg.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/H5Cdbg.c b/src/H5Cdbg.c index 455b653..85f25b3 100644 --- a/src/H5Cdbg.c +++ b/src/H5Cdbg.c @@ -420,11 +420,6 @@ H5C_dump_coll_write_list(H5C_t * cache_ptr, char * calling_fcn) (int)(entry_ptr->is_dirty), entry_ptr->type->name); - /* HDfprintf(stdout, " node_ptr = 0x%llx, item = %p\n", - (unsigned long long)node_ptr, - H5SL_item(node_ptr)); - */ - node_ptr = H5SL_next(node_ptr); if ( node_ptr != NULL ) -- cgit v0.12 From 9742792f8ca9af30c7de2d479337389678c33f59 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 11 Apr 2017 11:59:27 -0500 Subject: Fix for H5Dset_extent test failure with extensive array indexing (HDFFV-9771) 1) Calculate chunk index for extensive array index based on swizzled max chunks when unlim_dim > 0 2) Minor fixes to test/fheap.c that somehow were missed from last check in. See pull request #396 review comments. --- src/H5Dearray.c | 15 +++++++++++--- src/H5Oprivate.h | 1 + test/fheap.c | 62 +++++++++++++++++++++++++++---------------------------- test/set_extent.c | 18 ---------------- 4 files changed, 44 insertions(+), 52 deletions(-) diff --git a/src/H5Dearray.c b/src/H5Dearray.c index e9dbd0d..240afb7 100644 --- a/src/H5Dearray.c +++ b/src/H5Dearray.c @@ -1137,7 +1137,7 @@ H5D__earray_idx_get_addr(const H5D_chk_idx_info_t *idx_info, H5D_chunk_ud_t *uda H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ @@ -1202,7 +1202,8 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* "Swizzle" constant dimensions for this dataset */ if(layout->u.earray.unlim_dim > 0) { - hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of # of chunks in each dimension */ + hsize_t swizzled_max_chunks[H5O_LAYOUT_NDIMS]; /* Swizzled form of max # of chunks in each dimension */ /* Get the swizzled chunk dimensions */ HDmemcpy(layout->u.earray.swizzled_dim, layout->dim, (layout->ndims - 1) * sizeof(layout->dim[0])); @@ -1215,6 +1216,14 @@ H5D__earray_idx_resize(H5O_layout_chunk_t *layout) /* Get the swizzled "down" sizes for each dimension */ if(H5VM_array_down((layout->ndims - 1), swizzled_chunks, layout->u.earray.swizzled_down_chunks) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") + + /* Get the swizzled max number of chunks in each dimension */ + HDmemcpy(swizzled_max_chunks, layout->max_chunks, (layout->ndims - 1) * sizeof(swizzled_max_chunks[0])); + H5VM_swizzle_coords(hsize_t, swizzled_max_chunks, layout->u.earray.unlim_dim); + + /* Get the swizzled max "down" sizes for each dimension */ + if(H5VM_array_down((layout->ndims - 1), swizzled_max_chunks, layout->u.earray.swizzled_max_down_chunks) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, FAIL, "can't compute swizzled 'down' chunk size value") } /* end if */ done: @@ -1414,7 +1423,7 @@ H5D__earray_idx_remove(const H5D_chk_idx_info_t *idx_info, H5D_chunk_common_ud_t H5VM_swizzle_coords(hsize_t, swizzled_coords, idx_info->layout->u.earray.unlim_dim); /* Calculate the index of this chunk */ - idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_down_chunks); + idx = H5VM_chunk_index(ndims, swizzled_coords, idx_info->layout->u.earray.swizzled_dim, idx_info->layout->u.earray.swizzled_max_down_chunks); } /* end if */ else { /* Calculate the index of this chunk */ diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index f0fbe72..0a4ed74 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -584,6 +584,7 @@ typedef struct H5O_layout_chunk_earray_t { unsigned unlim_dim; /* Rank of unlimited dimension for dataset */ uint32_t swizzled_dim[H5O_LAYOUT_NDIMS]; /* swizzled chunk dimensions */ hsize_t swizzled_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled "down" size of number of chunks in each dimension */ + hsize_t swizzled_max_down_chunks[H5O_LAYOUT_NDIMS]; /* swizzled max "down" size of number of chunks in each dimension */ } H5O_layout_chunk_earray_t; typedef struct H5O_layout_chunk_bt2_t { diff --git a/test/fheap.c b/test/fheap.c index 77de4a8..d2a7900 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -553,7 +553,7 @@ begin_test(fheap_test_param_t *tparam, const char *base_desc, del_str = get_del_string(tparam); HDassert(del_str); test_desc = (char *)H5MM_malloc(HDstrlen(del_str) + HDstrlen(base_desc)); - sprintf(test_desc, base_desc, del_str); + HDsprintf(test_desc, base_desc, del_str); TESTING(test_desc); H5MM_xfree(del_str); H5MM_xfree(test_desc); @@ -7683,10 +7683,10 @@ test_man_incr_insert_remove(hid_t fapl, H5HF_create_t *cparam, fheap_test_param_ TESTING("incremental object insertion and removal") for(i = 0; i < 100; i++) { - sprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); + HDsprintf(obj1.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", i); for(j = 0; j < i; j++) { - sprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); + HDsprintf(obj2.b, "%s%d", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", j); if(H5HF_remove(fh, dxpl, heap_id[j]) < 0) FAIL_STACK_ERROR @@ -16393,7 +16393,7 @@ main(void) * running time will be long. */ if(ExpressMode > 1) - printf("***Express test mode on. Some tests may be skipped\n"); + HDprintf("***Express test mode on. Some tests may be skipped\n"); else if(ExpressMode == 0) num_pb_fs = NUM_PB_FS; @@ -16475,12 +16475,12 @@ main(void) switch(curr_test) { /* "Normal" testing parameters */ case FHEAP_TEST_NORMAL: - puts("Testing with normal parameters"); + HDputs("Testing with normal parameters"); break; /* "Re-open heap" testing parameters */ case FHEAP_TEST_REOPEN: - puts("Testing with reopen heap flag set"); + HDputs("Testing with reopen heap flag set"); tparam.reopen_heap = FHEAP_TEST_REOPEN; break; @@ -16512,12 +16512,12 @@ main(void) switch(fill) { /* "Bulk fill" heap blocks with 'large' objects */ case FHEAP_TEST_FILL_LARGE: - puts("Bulk-filling blocks w/large objects"); + HDputs("Bulk-filling blocks w/large objects"); break; /* "Bulk fill" heap blocks with 'single' objects */ case FHEAP_TEST_FILL_SINGLE: - puts("Bulk-filling blocks w/single object"); + HDputs("Bulk-filling blocks w/single object"); break; /* An unknown test? */ @@ -16568,25 +16568,25 @@ main(void) * level of complexity gradually. -QAK */ if(ExpressMode > 1) - printf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); + HDprintf("***Express test mode on. test_man_start_5th_recursive_indirect is skipped\n"); else nerrors += test_man_start_5th_recursive_indirect(fapl, &small_cparam, &tparam); /* * Test fractal heap object deletion */ - /* Simple removal */ - nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); - nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_REVERSE; - nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_FORWARD; - nerrors += test_man_remove_three_larger(fapl, &small_cparam, &tparam); - tparam.del_dir = FHEAP_DEL_REVERSE; + /* Simple removal */ + nerrors += test_man_remove_bogus(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_one(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_two(fapl, &small_cparam, &tparam); + nerrors += test_man_remove_one_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_REVERSE; + nerrors += test_man_remove_two_larger(fapl, &small_cparam, &tparam); + tparam.del_dir = FHEAP_DEL_FORWARD; + 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 */ @@ -16613,7 +16613,7 @@ main(void) nerrors += test_man_remove_first_two_rows(fapl, &small_cparam, &tparam); nerrors += test_man_remove_first_four_rows(fapl, &small_cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { nerrors += test_man_remove_all_root_direct(fapl, &small_cparam, &tparam); nerrors += test_man_remove_2nd_indirect(fapl, &small_cparam, &tparam); @@ -16643,7 +16643,7 @@ main(void) nerrors += test_man_fill_3rd_direct_less_one_fill_direct_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_1st_row_3rd_direct_fill_2nd_direct_less_one_wrap_start_block_add_skipped(fapl, &small_cparam, &tparam); if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { nerrors += test_man_fill_3rd_direct_fill_direct_skip_start_block_add_skipped(fapl, &small_cparam, &tparam); nerrors += test_man_fill_3rd_direct_fill_2nd_direct_fill_direct_skip_3rd_indirect_start_block_add_skipped(fapl, &small_cparam, &tparam); @@ -16684,12 +16684,12 @@ main(void) switch(id_len) { /* Use "normal" form for 'huge' object's heap IDs */ case 0: - puts("Using 'normal' heap ID format for 'huge' objects"); + HDputs("Using 'normal' heap ID format for 'huge' objects"); break; /* Use "direct" form for 'huge' object's heap IDs */ case 1: - puts("Using 'direct' heap ID format for 'huge' objects"); + HDputs("Using 'direct' heap ID format for 'huge' objects"); /* Adjust actual length of heap IDs for directly storing 'huge' object's file offset & length in heap ID */ tparam.actual_id_len = 17; /* 1 + 8 (file address size) + 8 (file length size) */ @@ -16698,7 +16698,7 @@ main(void) /* Use "direct" storage for 'huge' objects and larger IDs for 'tiny' objects */ case 2: small_cparam.id_len = 37; - puts("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); + HDputs("Using 'direct' heap ID format for 'huge' objects and larger IDs for 'tiny' objects"); tparam.actual_id_len = 37; break; @@ -16756,10 +16756,10 @@ main(void) /* Random object insertion & deletion */ if(ExpressMode > 1) - printf("***Express test mode on. Some tests skipped\n"); + HDprintf("***Express test mode on. Some tests skipped\n"); else { /* Random tests using "small" heap creation parameters */ - puts("Using 'small' heap creation parameters"); + HDputs("Using 'small' heap creation parameters"); /* (reduce size of tests when re-opening each time) */ /* XXX: Try to speed things up enough that these tests don't have to be reduced when re-opening */ @@ -16772,7 +16772,7 @@ main(void) nerrors += test_random_pow2((curr_test == FHEAP_TEST_NORMAL ? (hsize_t)(100*1000*1000) : (hsize_t)(4*1000*1000)), fapl, &small_cparam, &tparam); /* Random tests using "large" heap creation parameters */ - puts("Using 'large' heap creation parameters"); + HDputs("Using 'large' heap creation parameters"); tparam.actual_id_len = LARGE_HEAP_ID_LEN; /* (reduce size of tests when re-opening each time) */ @@ -16818,7 +16818,7 @@ main(void) if(nerrors) goto error; - puts("All fractal heap tests passed."); + HDputs("All fractal heap tests passed."); /* Release space for the shared objects */ H5MM_xfree(shared_wobj_g); @@ -16840,7 +16840,7 @@ HDfprintf(stderr, "Uncomment cleanup!\n"); return 0; error: - puts("*** TESTS FAILED ***"); + HDputs("*** TESTS FAILED ***"); H5E_BEGIN_TRY { H5MM_xfree(shared_wobj_g); H5MM_xfree(shared_robj_g); diff --git a/test/set_extent.c b/test/set_extent.c index 949120b..052a35a 100644 --- a/test/set_extent.c +++ b/test/set_extent.c @@ -2603,15 +2603,6 @@ static int test_random_rank4( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /* *** FIXME *** - * Skip the test if an extensible array index is requested, as resizing - * them is broken. - * - * Remove these lines as appropriate when these problems are fixed. - */ - if(index_type == RANK4_INDEX_EARRAY) - return 0; - /* create a new file */ h5_fixname(FILENAME[4], fapl, filename, sizeof filename); if ((file = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) @@ -2816,15 +2807,6 @@ static int test_random_rank4_vl( hid_t fapl, hid_t dcpl, hbool_t do_fillvalue, volatile unsigned i, j, k, l, m; /* Local indices */ char filename[NAME_BUF_SIZE]; - /* *** FIXME *** - * Skip the test if an extensible array index is requested, as resizing - * them is broken. - * - * Remove these lines as appropriate when these problems are fixed. - */ - if(index_type == RANK4_INDEX_EARRAY) - return 0; - /* Initialize fill value buffers so they aren't freed in case of an error */ fill_value.len = 0; fill_value.p = NULL; -- cgit v0.12 From e3d8dacaadbbb886b5bca52ff27f4aac5c5ea0a8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 11 Apr 2017 12:18:49 -0500 Subject: Combined the README_DEVEL and README, and removed out-dated README material --- fortran/src/README | 260 ++++++++++++---------------------------- fortran/src/README_DEVELOPEMENT | 38 ------ 2 files changed, 78 insertions(+), 220 deletions(-) delete mode 100644 fortran/src/README_DEVELOPEMENT diff --git a/fortran/src/README b/fortran/src/README index 7af5df3..a258e07 100644 --- a/fortran/src/README +++ b/fortran/src/README @@ -1,122 +1,18 @@ +=================================== +README for the Fortran APIs to HDF5 +=================================== - README for the FORTRAN90 Prototype APIs to HDF5 - - -This distribution contains the HDF5 FORTRAN90 APIs source code (prototype) -based on the HDF5 1.2.2 release (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current), -tests and examples. - -This prototype supports a selected subset of the HDF5 Library functionality. -A complete list of the Fortran subroutines can be found in the HDF5 -Reference Manual provided with this release. -Check the online documentation at http://hdf.ncsa.uiuc.edu/HDF5/doc (select -the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column) or -H5_F90.R1.2.2.RefMan.tar at ftp://hdf.ncsa.uiuc.edu/HDF5/fortran . - -Changes since last release (October 1999) -========================================= -* Support for Linux -* Support for parallel features (tested on O2K platform only) -* Most of the functions from the H5R, H5P, H5T, H5E and H5I interfaces were - implemented. See Reference Manual for complete list. The new functions - include support for object and dataset region references, and for - compound datatypes. -* This prototype supports more predefined types. See list below in - the "About the Fortran APIs" section. -* This prototype supports T3E and T3E with mpt 1.3. One has to modify - H5Dff.f90, H5Aff.f90, H5Pff.f90 to comment lines with the module procedures for - double precision datatypes. See source code. - -Supported platforms -=================== -The FORTRAN90 APIs provided here are known to work with the -following platforms and compilers: - - * SunOS 5.6 with WorkshopCompilers 4.2 Fortran 90 1.2 - * SunOS 5.7 with WorkshopCompilers 5.0 Fortran 90 2.0 - * OSF1 V4.0 with Digital Fortran 90 4.1 - * Linux RedHat 6.1, Kernel 2.2.12 with PGF90 - * T3E with Cray Fortran: Version 3.4.0.0 - with mpt 1.3 - -Compilation -=========== - -1. Install HDF5 Release 1.2.2 on your system - (ftp://ftp.ncsa.uiuc.edu/HDF/HDF5/current). If you are using a - binary distribution provided by the HDF group, make sure that a GZIP - library is installed on your system. If you do not have a GZIP library, - you may copy it from the HDF FTP server. - -2. In the src directory copy H5fortran_types.f90_ to - H5fortran_types.f90, where is one of the following: - - solaris - digunix - linux - - Example: On Digital Unix systems use the following command - cp H5fortran_types.f90_digunix H5fortran_types.f90 - -3. Edit Makefile_in the src/, test/ and examples/ directories - to specify the locations of the HDF5 C Library, the GZIP Library, and the - corresponding include files on your system. - -4. In the src directory, run make to create the HDF5 FORTRAN90 library - hdf5_fortran.a - make -f Makefile_ - - Example: On Solaris run - make -f Makefile_solaris - - The Fortran library hdf5_fortran.a will be created. - -5. In the test directory, build tests by running - make -f Makefile_ - This command will build fortranlib_test, fflush1 and fflush2 executables. - Run those executables to make sure that the library works on your system. - -6. In the examples directory, run - make -f Makefile_ - to build the following examples: - - fileexample - creates an HDF5 file - dsetexample - creates an empty dataset of integers - rwdsetexample - writes and reads to the dataset created by dsetexample - groupexample - creates a group in the file - grpsexample - creates groups using absolute and relative names - grpdsetexample - creates datasets in the groups - hyperslabexample - writes and reads a hyperslab - selectele - writes element selections - attrexample - creates and writes a dataset attribute - compound - creates, writes and reads one dim array of structures - mountexample - shows how to use mounting files to access a dataset - refobjexample - creates and stores references to the objects - refregexample - creates and stores references to the dataset regions - - The script run_example.sh runs the examples in the appropriate order. - - Use the HDF5 utility, h5dump, to see the content of the created HDF5 files. - -7. Install the HDF5 Reference Manual (in HTML format). The manual - can be found in the Unix tar file H5_F90.R1.2.2.RefMan.tar - on the ftp server and is served over the Web from - http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select the "HDF5 Fortran90 Docs" - link at the bottom of the left-hand column). - - -8. Send bug reports and comments to hdfhelp@ncsa.uiuc.edu - -User's Guide Notes -+++++++++++++++++++ +This directory contains Fortran APIs for HDF5 Library functionality. +A complete list of implemented Fortran subroutines can be found in the HDF5 +Reference Manual. About the source code organization ================================== The Fortran APIs are organized in modules parallel to the HDF5 Interfaces. -Each module is in a separate file with the name H5*ff.f. Corresponding C +Each module is in a separate file with the name H5*ff.F90. Corresponding C stubs are in the H5*f.c files. For example, the Fortran File APIs are in -the file H5Fff.f and the corresponding C stubs are in the file H5Ff.c. +the file H5Fff.F90 and the corresponding C stubs are in the file H5Ff.c. Each module contains Fortran definitions of the constants, interfaces to the subroutines if needed, and the subroutines themselves. @@ -124,31 +20,29 @@ the subroutines if needed, and the subroutines themselves. Users must use constant names in their programs instead of the numerical values, as the numerical values are subject to change without notice. -About the Fortran APIs -======================= +Quick overview of the Fortran APIs +============================================== + +* An in-depth description of each Fortran API and its parameters can + be found in the HDF5 Reference Manual. * The Fortran APIs come in the form of Fortran subroutines. * Each Fortran subroutine name is derived from the corresponding C function name by adding "_f" to the name. For example, the name of the C function to create an HDF5 file is H5Fcreate; the corresponding Fortran subroutine - is h5fcreate_f. - -* A description of each Fortran subroutine and its parameters can be found - following the description of the corresponding C function in the - Reference Manual provided with this release. The manual can be found in - the Unix tar file H5_F90.R1.2.2.tar in this directory and - is served over the Web from http://hdf.ncsa.uiuc.edu/HDF5/doc/ (select - the "HDF5 Fortran90 Docs" link at the bottom of the left-hand column). + is h5fcreate_f. -* The parameter list for each Fortran subroutine has two more parameters - than the corresponding C function. These additional parameters hold +* The parameter list for each Fortran subroutine usually has two more parameters + than the corresponding C function. These additional parameters typically hold the return value and an error code. The order of the Fortran subroutine - parameters may differ from the order of the C function parameters. - The Fortran subroutine parameters are listed in the following order: + parameters may differ from the order of the C function parameters. + + The Fortran subroutine parameters are usually listed in the following order: -- required input parameters, -- output parameters, including return value and error code, and - -- optional input parameters. + optional input parameters. + For example, the C function to create a dataset has the following prototype: @@ -158,72 +52,35 @@ About the Fortran APIs The corresponding Fortran subroutine has the following form: - SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, - hdferr, creation_prp) - + SUBROUTINE h5dcreate_f(loc_id, name, type_id, space_id, dset_id, & + hdferr, dset_creation_prp, link_creation_prp, dset_access_prop) + The first four parameters of the Fortran subroutine correspond to the C function parameters. The fifth parameter dset_id is an output parameter and contains a valid dataset identifier if the value of the - sixth output parameter hdferr indicates successful completion. + sixth output parameter, hdferr, indicates successful completion. (Error code descriptions are provided with the subroutine descriptions - in the Reference Manual.) The seventh input parameter creation_prp - is optional, and may be omitted when the default creation property - list is used. - (XXX: Update this! - QAK) - -* Parameters to the Fortran subroutines have one of the following - predefined datatypes (see the file H5fortran_types.f90 for KIND - definitions): + in the Reference Manual.) The last three input parameters are optional + and may be omitted, resulting in default values being used. + +* Parameters to the Fortran subroutines typically include + predefined datatypes (see the build-time generated file + H5fortran_types.F90 for a complete listing): INTEGER(HID_T) compares with hid_t type in HDF5 C APIs INTEGER(HSIZE_T) compares with hsize_t in HDF5 C APIs INTEGER(HSSIZE_T) compares with hssize_t in HDF5 C APIs INTEGER(SIZE_T) compares with the C size_t type + These integer types usually correspond to 4 or 8 byte integers, - depending on the FORTRAN90 compiler and corresponding HDF5 + depending on the Fortran compiler and corresponding HDF5 C library definitions. - The H5R module defines two types: - TYPE(HOBJ_REF_T_F) compares to the hobj_ref_t in HDF5 C API - TYPE(HDSET_REG_REF_T_F) compares to hdset_reg_ref_t in HDF5 C API - These types are represented by character arrays now. - The internal representation can be changed in the future. - -* Each Fortran application must call the h5init_types subroutine to +* Each Fortran application must call the h5open_f subroutine to initialize the Fortran predefined datatypes before calling the HDF5 Fortran - subroutines. The application must call the h5close_types subroutine - after all calls to the HDF5 Fortran Library. - -* The following predefined types are implemented in this prototype: - - H5T_NATIVE_INTEGER - H5T_NATIVE_REAL - H5T_NATIVE_DOUBLE - H5T_NATIVE_CHARACTER - H5T_STD_REF_OBJ - H5T_STD_REF_DSETREG - H5T_IEEE_F32BE - H5T_IEEE_F32LE - H5T_IEEE_F64BE - H5T_IEEE_F64LE - H5T_STD_I8BE - H5T_STD_I8LE - H5T_STD_I16BE - H5T_STD_I16LE - H5T_STD_I32BE - H5T_STD_I32LE - H5T_STD_I64BE - H5T_STD_I64LE - H5T_STD_U8BE - H5T_STD_U8LE - H5T_STD_U16BE - H5T_STD_U16LE - H5T_STD_U32BE - H5T_STD_U32LE - H5T_STD_U64BE - H5T_STD_U64LE - - + subroutines. The application should call the h5close_f subroutine + after all calls to the HDF5 Fortran Library. + * When a C application reads data stored from a Fortran program, the data will appear to be transposed due to the difference in the C - Fortran storage order. For example, if Fortran writes a 4x6 two-dimensional dataset @@ -233,6 +90,45 @@ About the Fortran APIs * Fortran indices are 1 based. -* Compound datatype datasets can be written or read by atomic fields only. +============================ +FOR DEVELOPERS +============================ + +Procedure to add a new function +---------------------------------- + +(1) Edit the fortran/src/H5*ff.F90 file +(2) Edit the fortran/src/H5*f.c file +(3) Edit the fortran/src/H5f90proto.h file +(4) Add the new function to fortran/src/hdf5_fortrandll.def.in + +Procedure for passing C variables to Fortran +--------------------------------------------- + +(1) Find the C struct name you are interested in: + (a) src/H5public.h if it is a generic type, i.e. H5_* + or + (b) src/H5*public.h if is a specific type, i.e. H5*_ + +(2) Put that structure into an array that will be passed to fortran in: + (a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine) + (b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call + +(3) Edit the function call in fortran/src/H5_ff.F90 + (a) edit the call: FUNCTION h5init_flags_c + (b) edit h5init_flags_c call in h5open_f to match the number of arguments passing + +(4) add the size of the array and array to fortran/src/H5f90global.F90 + - must match the size found it H5_f.c + +NOTE: To just add a default C value argument, do steps (2a) and (4) + + +Procedure for adding a new file to the repository +-------------------------------------------------- + +Add the name of the file to the: + (1) Makefile.am located in the same directory as the newfile + (2) CMakeLists.txt located in the same directory as the newfile + (3) MANIFEST located in the top level directory -Not all of the APIs provided with this prototype have been fully tested. diff --git a/fortran/src/README_DEVELOPEMENT b/fortran/src/README_DEVELOPEMENT deleted file mode 100644 index 43982e1..0000000 --- a/fortran/src/README_DEVELOPEMENT +++ /dev/null @@ -1,38 +0,0 @@ -Procedure to add a new function ---------------------------------- - -(1) Edit the fortran/src/H5*ff.f90 file -(2) Edit the fortran/src/H5*f.c file -(3) Edit the fortran/src/H5f90proto.h file -(4) Add the new function to fortran/src/hdf5_fortrandll.def.in - -Procedure for passing C variables to Fortran ---------------------------------------------- - -(1) Find the C struct name you are interested in: - (a) src/H5public.h if it is a generic type, i.e. H5_* - or - (b) src/H5*public.h if is a specific type, i.e. H5*_ - -(2) Put that structure into an array that will be passed to fortran in: - (a) fortran/src/H5_f.c (add to nh5init_flags_c subroutine) - (b) edit fortran/src/H5f90proto.h and edit nh5init_flags_c interface call - -(3) Edit the function call in fortran/src/H5_ff.f90 - (a) edit the call: FUNCTION h5init_flags_c - (b) edit h5init_flags_c call in h5open_f to match the number of arguments passing - -(4) add the size of the array and array to fortran/src/H5f90global.f90 - - must match the size found it H5_f.c - -NOTE: To just add a default C value argument, do steps (2a) and (4) - - -Procedure for adding a new file to the repository --------------------------------------------------- - -Add the name of the file to the: - (1) Makefile.am located in the same directory as the newfile - (2) CMakeLists.txt located in the same directory as the newfile - (3) MANIFEST located in the top level directory - -- cgit v0.12 From a79ab2d39ecc699d600edda628c6a195429bf74e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Apr 2017 12:57:19 -0500 Subject: DAILYTEST-250 change test props to reduce timeout --- test/CMakeTests.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index f372acf..cbab6fe 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -750,7 +750,7 @@ if (NOT CYGWIN) endif () set_tests_properties (H5TEST-cache PROPERTIES DEPENDS H5TEST-clear-cache-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=${HDF_TEST_EXPRESS}" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache PROPERTIES TIMEOUT 1800) @@ -768,7 +768,7 @@ add_test ( add_test (NAME H5TEST-cache_image COMMAND $) set_tests_properties (H5TEST-cache_image PROPERTIES DEPENDS H5TEST-clear-cache_image-objects - ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" + ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5TestExpress=3" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) -- cgit v0.12 From 265950a83a68ea55b5bc8dcbefa2d09b4f8110be Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 11 Apr 2017 13:16:16 -0500 Subject: updated with README changes --- MANIFEST | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST b/MANIFEST index b312cab..5710f6c 100644 --- a/MANIFEST +++ b/MANIFEST @@ -247,7 +247,6 @@ ./fortran/src/HDF5.F90 ./fortran/src/Makefile.am ./fortran/src/README -./fortran/src/README_DEVELOPEMENT _DO_NOT_DISTRIBUTE_ ./fortran/src/h5fc.in ./fortran/src/hdf5_fortrandll.def.in -- cgit v0.12 From 8a9e4b94c3938f4c42ad9399737afc6478ded160 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 11 Apr 2017 15:10:02 -0500 Subject: Fix URL name --- java/src/jni/exceptionImp.c | 2 +- java/src/jni/h5Constants.c | 2 +- java/src/jni/h5Imp.c | 2 +- java/src/jni/h5aImp.c | 2 +- java/src/jni/h5dImp.c | 2 +- java/src/jni/h5eImp.c | 2 +- java/src/jni/h5fImp.c | 2 +- java/src/jni/h5gImp.c | 2 +- java/src/jni/h5iImp.c | 2 +- java/src/jni/h5jni.h | 2 +- java/src/jni/h5lImp.c | 2 +- java/src/jni/h5oImp.c | 2 +- java/src/jni/h5pImp.c | 2 +- java/src/jni/h5plImp.c | 2 +- java/src/jni/h5rImp.c | 2 +- java/src/jni/h5sImp.c | 2 +- java/src/jni/h5tImp.c | 2 +- java/src/jni/h5util.c | 2 +- java/src/jni/h5util.h | 2 +- java/src/jni/h5zImp.c | 2 +- java/src/jni/nativeData.c | 2 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/java/src/jni/exceptionImp.c b/java/src/jni/exceptionImp.c index 28eec21..d0e7790 100644 --- a/java/src/jni/exceptionImp.c +++ b/java/src/jni/exceptionImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5Constants.c b/java/src/jni/h5Constants.c index c6aa16c..ddca853 100644 --- a/java/src/jni/h5Constants.c +++ b/java/src/jni/h5Constants.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5Imp.c b/java/src/jni/h5Imp.c index 7a24b6f..e548363 100644 --- a/java/src/jni/h5Imp.c +++ b/java/src/jni/h5Imp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5aImp.c b/java/src/jni/h5aImp.c index 5af8aae..5445904 100644 --- a/java/src/jni/h5aImp.c +++ b/java/src/jni/h5aImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index ed1db41..9765dc8 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5eImp.c b/java/src/jni/h5eImp.c index 6e05515..05a7848 100644 --- a/java/src/jni/h5eImp.c +++ b/java/src/jni/h5eImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5fImp.c b/java/src/jni/h5fImp.c index 058ba26..4f0e569 100644 --- a/java/src/jni/h5fImp.c +++ b/java/src/jni/h5fImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5gImp.c b/java/src/jni/h5gImp.c index c40ed64..d724475 100644 --- a/java/src/jni/h5gImp.c +++ b/java/src/jni/h5gImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5iImp.c b/java/src/jni/h5iImp.c index 71e1b71..9c946df 100644 --- a/java/src/jni/h5iImp.c +++ b/java/src/jni/h5iImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5jni.h b/java/src/jni/h5jni.h index 9414d31..cef3bd0 100644 --- a/java/src/jni/h5jni.h +++ b/java/src/jni/h5jni.h @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5lImp.c b/java/src/jni/h5lImp.c index 473b1c7..f7a9df1 100644 --- a/java/src/jni/h5lImp.c +++ b/java/src/jni/h5lImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5oImp.c b/java/src/jni/h5oImp.c index 24f6988..a33d1d7 100644 --- a/java/src/jni/h5oImp.c +++ b/java/src/jni/h5oImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5pImp.c b/java/src/jni/h5pImp.c index f39f0e6..c9bd4aa 100644 --- a/java/src/jni/h5pImp.c +++ b/java/src/jni/h5pImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5plImp.c b/java/src/jni/h5plImp.c index 34d6f8b..09a1032 100644 --- a/java/src/jni/h5plImp.c +++ b/java/src/jni/h5plImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5rImp.c b/java/src/jni/h5rImp.c index 647f973..3dcbb8d 100644 --- a/java/src/jni/h5rImp.c +++ b/java/src/jni/h5rImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ #ifdef __cplusplus diff --git a/java/src/jni/h5sImp.c b/java/src/jni/h5sImp.c index d996ae5..929f6d6 100644 --- a/java/src/jni/h5sImp.c +++ b/java/src/jni/h5sImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5tImp.c b/java/src/jni/h5tImp.c index 1467b41..26f9b5c 100644 --- a/java/src/jni/h5tImp.c +++ b/java/src/jni/h5tImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5util.c b/java/src/jni/h5util.c index 0d2999a..17ed35e 100644 --- a/java/src/jni/h5util.c +++ b/java/src/jni/h5util.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5util.h b/java/src/jni/h5util.h index f690e8b..6194378 100644 --- a/java/src/jni/h5util.h +++ b/java/src/jni/h5util.h @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/h5zImp.c b/java/src/jni/h5zImp.c index 2c8d8c3..247d1cc 100644 --- a/java/src/jni/h5zImp.c +++ b/java/src/jni/h5zImp.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ diff --git a/java/src/jni/nativeData.c b/java/src/jni/nativeData.c index 8388c99..a123e0f 100644 --- a/java/src/jni/nativeData.c +++ b/java/src/jni/nativeData.c @@ -15,7 +15,7 @@ /* * For details of the HDF libraries, see the HDF Documentation at: - * http://hdfdfgroup.org/HDF5/doc/ + * http://hdfgroup.org/HDF5/doc/ * */ /* -- cgit v0.12 From 606529f5e0cffcea26af66106f094fbe350c5bac Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Wed, 12 Apr 2017 17:21:43 -0500 Subject: Due to HDFVIEW-19 add read VL as string function --- java/src/hdf/hdf5lib/H5.java | 3 ++ java/src/jni/h5dImp.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ java/src/jni/h5dImp.h | 9 +++++ 3 files changed, 103 insertions(+) diff --git a/java/src/hdf/hdf5lib/H5.java b/java/src/hdf/hdf5lib/H5.java index 0c11846..23e2a34 100644 --- a/java/src/hdf/hdf5lib/H5.java +++ b/java/src/hdf/hdf5lib/H5.java @@ -1798,6 +1798,9 @@ public class H5 implements java.io.Serializable { return H5Dread_short(dataset_id, mem_type_id, mem_space_id, file_space_id, xfer_plist_id, buf, true); } + public synchronized static native int H5DreadVL(long dataset_id, long mem_type_id, long mem_space_id, + long file_space_id, long xfer_plist_id, Object[] buf) throws HDF5LibraryException, NullPointerException; + public synchronized static native int H5Dread_string(long dataset_id, long mem_type_id, long mem_space_id, long file_space_id, long xfer_plist_id, String[] buf) throws HDF5LibraryException, NullPointerException; diff --git a/java/src/jni/h5dImp.c b/java/src/jni/h5dImp.c index 9765dc8..0bb015e 100644 --- a/java/src/jni/h5dImp.c +++ b/java/src/jni/h5dImp.c @@ -55,6 +55,7 @@ extern jobject visit_callback; /* Local Prototypes */ /********************/ +static herr_t H5DreadVL_asstr (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DreadVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DreadVL_array (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); static herr_t H5DwriteVL_str (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf); @@ -994,6 +995,96 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1double /* * Class: hdf_hdf5lib_H5 + * Method: H5DreadVL + * Signature: (JJJJJ[Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5DreadVL + (JNIEnv *env, jclass clss, jlong dataset_id, jlong mem_type_id, jlong mem_space_id, + jlong file_space_id, jlong xfer_plist_id, jobjectArray buf) +{ + herr_t status = -1; + htri_t isVlenStr=0; + + if (buf == NULL) { + h5nullArgument(env, "H5DreadVL: buf is NULL"); + } /* end if */ + else { + isVlenStr = H5Tdetect_class((hid_t)mem_type_id, H5T_STRING); + + if (isVlenStr) + h5badArgument(env, "H5DreadVL: type is not variable length non-string"); + else + status = H5DreadVL_asstr(env, (hid_t)dataset_id, (hid_t)mem_type_id, + (hid_t)mem_space_id, (hid_t)file_space_id, + (hid_t)xfer_plist_id, buf); + } /* end else */ + + return (jint)status; +} /* end Java_hdf_hdf5lib_H5_H5Dread_1VLStrings */ + +herr_t +H5DreadVL_asstr + (JNIEnv *env, hid_t did, hid_t tid, hid_t mem_sid, hid_t file_sid, hid_t xfer_plist_id, jobjectArray buf) +{ + jint i; + jint n; + jstring jstr; + h5str_t h5str; + hvl_t *rdata; + size_t size; + size_t max_len = 0; + herr_t status = -1; + + n = ENVPTR->GetArrayLength(ENVPAR buf); + rdata = (hvl_t*)HDcalloc((size_t)n, sizeof(hvl_t)); + if (rdata == NULL) { + h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buff for read"); + } /* end if */ + else { + status = H5Dread(did, tid, mem_sid, file_sid, xfer_plist_id, rdata); + + if (status < 0) { + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + h5JNIFatalError(env, "H5DreadVL_notstr: failed to read data"); + } /* end if */ + else { + max_len = 1; + for (i=0; i < n; i++) { + if ((rdata + i)->len > max_len) + max_len = (rdata + i)->len; + } + + size = H5Tget_size(tid) * max_len; + HDmemset(&h5str, 0, sizeof(h5str_t)); + h5str_new(&h5str, 4 * size); + + if (h5str.s == NULL) { + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + h5JNIFatalError(env, "H5DreadVL_notstr: failed to allocate buf"); + } /* end if */ + else { + for (i=0; i < n; i++) { + h5str.s[0] = '\0'; + h5str_sprintf(&h5str, did, tid, rdata+i, 0); + jstr = ENVPTR->NewStringUTF(ENVPAR h5str.s); + ENVPTR->SetObjectArrayElement(ENVPAR buf, i, jstr); + } /* end for */ + h5str_free(&h5str); + + H5Dvlen_reclaim(tid, mem_sid, xfer_plist_id, rdata); + HDfree(rdata); + } /* end else */ + } /* end else */ + } /* end else */ + + return status; +} + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Dread_string * Signature: (JJJJJ[Ljava/lang/String;)I */ diff --git a/java/src/jni/h5dImp.h b/java/src/jni/h5dImp.h index eb26265..e79c590 100644 --- a/java/src/jni/h5dImp.h +++ b/java/src/jni/h5dImp.h @@ -206,6 +206,15 @@ Java_hdf_hdf5lib_H5_H5Dwrite_1double /* * Class: hdf_hdf5lib_H5 + * Method: H5DreadVL + * Signature: (JJJJJ[Ljava/lang/String;)I + */ +JNIEXPORT jint JNICALL +Java_hdf_hdf5lib_H5_H5DreadVL +(JNIEnv*, jclass, jlong, jlong, jlong, jlong, jlong, jobjectArray); + +/* + * Class: hdf_hdf5lib_H5 * Method: H5Dread_string * Signature: (JJJJJ[Ljava/lang/String;)I */ -- cgit v0.12 From 3d1b227a67b557da247f6b683f58617b6d75bfdb Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Thu, 13 Apr 2017 02:47:23 -0500 Subject: Skip tests for page buffering in test/fheap.c for parallel build Skip the two tests for page buffering in test/fheap.c because this feature is disabled in parallel. Activate full testing when this feature is re-enabled in the future for parallel build. --- test/fheap.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/fheap.c b/test/fheap.c index d2a7900..e741aad 100644 --- a/test/fheap.c +++ b/test/fheap.c @@ -16388,14 +16388,23 @@ main(void) /* * Caution when turning on ExpressMode 0: - * It will activate testing with different combinations of + * It will activate testing with different combinations of * page buffering and file space strategy and the * running time will be long. + * For parallel build, the last two tests for page buffering + * are skipped because this feature is disabled in parallel. + * Activate full testing when this feature is re-enabled + * in the future for parallel build. */ if(ExpressMode > 1) HDprintf("***Express test mode on. Some tests may be skipped\n"); - else if(ExpressMode == 0) + else if(ExpressMode == 0) { +#ifdef H5_HAVE_PARALLEL + num_pb_fs = NUM_PB_FS - 2; +#else num_pb_fs = NUM_PB_FS; +#endif + } /* Initialize heap creation parameters */ init_small_cparam(&small_cparam); -- cgit v0.12 From 9363223fb688bfb484acad07f7119eb21f5e3307 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 13 Apr 2017 13:37:56 -0500 Subject: HDFFV-10170 chnage test libs to noinst type --- test/Makefile.am | 5 +---- tools/test/h5repack/Makefile.am | 4 +--- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index a64cd0e..7d4fc7c 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,15 +106,12 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* - else # The libh5test library provides common support code for the tests. noinst_LTLIBRARIES=libh5test.la diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 5c284b3..22c6d96 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -47,12 +47,10 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c -install-exec-hook: - $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 4651eb738df5d31c62eae1f9fb70b1685c610e0c Mon Sep 17 00:00:00 2001 From: mainzer Date: Fri, 14 Apr 2017 23:44:23 -0500 Subject: Express test mods to test/cache.c Modified test/cache.c to skip the smoke checks with paged aggregation for all express test levels other than 0 Change to src/H5PL.c seems to be the result of autogen.sh. As it seems to be correct, I am checking it in. Tested serial and parallel (debug only) on jelly. --- src/H5PL.c | 2 ++ test/cache.c | 106 +++++++++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 91 insertions(+), 17 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index bfa3ace..a083f5a 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -564,6 +564,7 @@ H5PLremove(unsigned int index) unsigned int plindex; FUNC_ENTER_API(FAIL) + H5TRACE1("e", "Iu", index); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) @@ -608,6 +609,7 @@ H5PLget(unsigned int index, char *pathname/*out*/, size_t size) char *dl_path = NULL; FUNC_ENTER_API(FAIL) + H5TRACE3("Zs", "Iuxz", index, pathname, size); if(H5PL_num_paths_g == 0) HGOTO_ERROR(H5E_PLUGIN, H5E_NOSPACE, FAIL, "no directories in table") if(index >= H5PL_MAX_PATH_NUM) diff --git a/test/cache.c b/test/cache.c index ba6fb0e..6658c70 100644 --- a/test/cache.c +++ b/test/cache.c @@ -241,10 +241,16 @@ smoke_check_1(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache, paged aggregation") + TESTING("smoke check #1P -- all clean, ins, dest, ren, 4/2 MB cache") else TESTING("smoke check #1 -- all clean, ins, dest, ren, 4/2 MB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -442,10 +448,16 @@ smoke_check_2(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache, paged aggregation") + TESTING("smoke check #2P -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache") else TESTING("smoke check #2 -- ~1/2 dirty, ins, dest, ren, 4/2 MB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -642,10 +654,16 @@ smoke_check_3(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache, paged aggregation") + TESTING("smoke check #3P -- all clean, ins, dest, ren, 2/1 KB cache") else TESTING("smoke check #3 -- all clean, ins, dest, ren, 2/1 KB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -843,10 +861,16 @@ smoke_check_4(int express_test, unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache, paged aggregation") + TESTING("smoke check #4P -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache") else TESTING("smoke check #4 -- ~1/2 dirty, ins, dest, ren, 2/1 KB cache") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1092,10 +1116,16 @@ smoke_check_5(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1, paged aggregation") + TESTING("smoke check #5P -- all clean, ins, prot, unprot, AR cache 1") else TESTING("smoke check #5 -- all clean, ins, prot, unprot, AR cache 1") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1330,10 +1360,16 @@ smoke_check_6(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #6 -- ~1/2 dirty, ins, prot, unprot, AR cache 1, paged aggregation") + TESTING("smoke check #6P -- ~1/2 dirty, ins, prot, unprot, AR cache 1") else TESTING("smoke check #6 -- ~1/2 dirty, ins, prot, unprot, AR cache 1") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + pass = TRUE; switch (express_test) @@ -1569,10 +1605,16 @@ smoke_check_7(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2, paged aggregation") + TESTING("smoke check #7P -- all clean, ins, prot, unprot, AR cache 2") else TESTING("smoke check #7 -- all clean, ins, prot, unprot, AR cache 2") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -1808,10 +1850,16 @@ smoke_check_8(int express_test, unsigned paged) }; if(paged) - TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2, paged aggregation") + TESTING("smoke check #8P -- ~1/2 dirty, ins, prot, unprot, AR cache 2") else TESTING("smoke check #8 -- ~1/2 dirty, ins, prot, unprot, AR cache 2") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2008,10 +2056,16 @@ smoke_check_9(int express_test, unsigned paged) H5C_t * cache_ptr = NULL; if(paged) - TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked, paged aggregation") + TESTING("smoke check #9P -- all clean, ins, dest, ren, 4/2 MB, corked") else TESTING("smoke check #9 -- all clean, ins, dest, ren, 4/2 MB, corked") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2330,10 +2384,16 @@ smoke_check_10(int express_test, unsigned paged) H5C_t * cache_ptr = NULL; if(paged) - TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked, paged aggregation") + TESTING("smoke check #10P -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked") else TESTING("smoke check #10 -- ~1/2 dirty, ins, dest, ren, 4/2 MB, corked") + if ( paged && ( express_test > 0 ) ) { + + SKIPPED(); + return(0); + } + switch (express_test) { case 0: @@ -2646,7 +2706,7 @@ express_test, unsigned paged) #endif /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ if(paged) - TESTING("write permitted check -- 1/0 MB cache, paged aggregation") + TESTING("write permitted check -- 1/0 MB cache (paged aggregation)") else TESTING("write permitted check -- 1/0 MB cache") @@ -13329,7 +13389,7 @@ check_multiple_read_protect(unsigned paged) test_entry_t * entry_ptr; if(paged) - TESTING("multiple read only protects on a single entry (paged aggregation)") + TESTING("multiple read only protects on a single entry (paged aggr)") else TESTING("multiple read only protects on a single entry") @@ -15954,7 +16014,7 @@ check_destroy_pinned_err(unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("destroy cache with permanently pinned entry error (paged aggregation)") + TESTING("destroy cache with permanently pinned entry error (pgd aggr)") else TESTING("destroy cache with permanently pinned entry error") @@ -24438,7 +24498,7 @@ check_auto_cache_resize_epoch_markers(unsigned paged) }; if(paged) - TESTING("automatic cache resize epoch marker management (paged aggregation)") + TESTING("automatic cache resize epoch marker management (paged aggr)") else TESTING("automatic cache resize epoch marker management") @@ -28230,13 +28290,13 @@ check_metadata_blizzard_absence(hbool_t fill_via_insertion, unsigned paged) if(fill_via_insertion) { if(paged) - TESTING("to ensure metadata blizzard absence when inserting (paged aggregation)") + TESTING("to ensure metadata blizzard absence when inserting (pgd aggr)") else TESTING("to ensure metadata blizzard absence when inserting") } /* end if */ else { if(paged) - TESTING("to ensure metadata blizzard absence on protect/unprotect (paged aggregation)") + TESTING("to ensure metadata blizzard absence on protect/unprotect (pa)") else TESTING("to ensure metadata blizzard absence on protect/unprotect") } /* end else */ @@ -34383,7 +34443,7 @@ check_entry_deletions_during_scans(unsigned paged) H5F_t * file_ptr = NULL; if(paged) - TESTING("entry deletion during list scan detection and adaption (paged aggregation)") + TESTING("entry deletion during list scan detection and adaption (par)") else TESTING("entry deletion during list scan detection and adaption") @@ -36394,6 +36454,18 @@ main(void) /* Test with paged aggregation enabled or not */ /* Each test will call setup_cache() which set up the file space strategy according to "paged" */ for(paged = FALSE; paged <= TRUE; paged++) { + + if ( paged ) { + + HDfprintf(stdout, + "\n\nRe-running tests with paged aggregation:\n"); + + if ( express_test > 0 ) + HDfprintf(stdout, " Skipping smoke checks.\n"); + + HDfprintf(stdout, "\n"); + } + nerrs += smoke_check_1(express_test, paged); nerrs += smoke_check_2(express_test, paged); nerrs += smoke_check_3(express_test, paged); -- cgit v0.12 From 6bbc8b69cfe1992d34e28d9f4c532323a412bbdf Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 11:32:32 -0500 Subject: HDFFV-10173 fix compile on VS2008 --- src/H5ACpublic.h | 236 +++++++++++++++++++++++++++---------------------------- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index 5fdb3f4..ca0e63f 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -70,65 +70,65 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the - * automatic cache resize code is run, and reports on its activities. + * reporting function. This function is invoked every time the + * automatic cache resize code is run, and reports on its activities. * - * This is a debugging function, and should normally be turned off. + * This is a debugging function, and should normally be turned off. * * open_trace_file: Boolean field indicating whether the trace_file_name - * field should be used to open a trace file for the cache. + * field should be used to open a trace file for the cache. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * The trace file is a debuging feature that allow the capture of - * top level metadata cache requests for purposes of debugging and/or - * optimization. This field should normally be set to FALSE, as - * trace file collection imposes considerable overhead. + * The trace file is a debuging feature that allow the capture of + * top level metadata cache requests for purposes of debugging and/or + * optimization. This field should normally be set to FALSE, as + * trace file collection imposes considerable overhead. * - * This field should only be set to TRUE when the trace_file_name - * contains the full path of the desired trace file, and either - * there is no open trace file on the cache, or the close_trace_file - * field is also TRUE. + * This field should only be set to TRUE when the trace_file_name + * contains the full path of the desired trace file, and either + * there is no open trace file on the cache, or the close_trace_file + * field is also TRUE. * * close_trace_file: Boolean field indicating whether the current trace - * file (if any) should be closed. + * file (if any) should be closed. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * See the above comments on the open_trace_file field. This field - * should be set to FALSE unless there is an open trace file on the - * cache that you wish to close. + * See the above comments on the open_trace_file field. This field + * should be set to FALSE unless there is an open trace file on the + * cache that you wish to close. * * trace_file_name: Full path of the trace file to be opened if the - * open_trace_file field is TRUE. + * open_trace_file field is TRUE. * * *** DEPRECATED *** Use H5Fstart/stop logging functions instead * - * In the parallel case, an ascii representation of the mpi rank of - * the process will be appended to the file name to yield a unique - * trace file name for each process. + * In the parallel case, an ascii representation of the mpi rank of + * the process will be appended to the file name to yield a unique + * trace file name for each process. * - * The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN - * characters. + * The length of the path must not exceed H5AC__MAX_TRACE_FILE_NAME_LEN + * characters. * * evictions_enabled: Boolean field used to either report the current - * evictions enabled status of the cache, or to set the cache's - * evictions enabled status. - * - * In general, the metadata cache should always be allowed to - * evict entries. However, in some cases it is advantageous to - * disable evictions briefly, and thereby postpone metadata - * writes. However, this must be done with care, as the cache - * can grow quickly. If you do this, re-enable evictions as - * soon as possible and monitor cache size. - * - * At present, evictions can only be disabled if automatic - * cache resizing is also disabled (that is, ( incr_mode == - * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There - * is no logical reason why this should be so, but it simplifies - * implementation and testing, and I can't think of any reason - * why it would be desireable. If you can think of one, I'll - * revisit the issue. + * evictions enabled status of the cache, or to set the cache's + * evictions enabled status. + * + * In general, the metadata cache should always be allowed to + * evict entries. However, in some cases it is advantageous to + * disable evictions briefly, and thereby postpone metadata + * writes. However, this must be done with care, as the cache + * can grow quickly. If you do this, re-enable evictions as + * soon as possible and monitor cache size. + * + * At present, evictions can only be disabled if automatic + * cache resizing is also disabled (that is, ( incr_mode == + * H5C_incr__off ) && ( decr_mode == H5C_decr__off )). There + * is no logical reason why this should be so, but it simplifies + * implementation and testing, and I can't think of any reason + * why it would be desireable. If you can think of one, I'll + * revisit the issue. * * set_initial_size: Boolean flag indicating whether the size of the * initial size of the cache is to be set to the value given in @@ -368,80 +368,80 @@ extern "C" { * * PHDF5 uses several strategies to prevent such inconsistencies in metadata, * all of which use the fact that the same stream of dirty metadata is seen - * by all processes for purposes of synchronization. This is done by + * by all processes for purposes of synchronization. This is done by * having each process count the number of bytes of dirty metadata generated, - * and then running a "sync point" whenever this count exceeds a user + * and then running a "sync point" whenever this count exceeds a user * specified threshold (see dirty_bytes_threshold below). * - * The current metadata write strategy is indicated by the + * The current metadata write strategy is indicated by the * metadata_write_strategy field. The possible values of this field, along * with the associated metadata write strategies are discussed below. * * dirty_bytes_threshold: Threshold of dirty byte creation used to - * synchronize updates between caches. (See above for outline and - * motivation.) + * synchronize updates between caches. (See above for outline and + * motivation.) * - * This value MUST be consistant across all processes accessing the - * file. This field is ignored unless HDF5 has been compiled for - * parallel. + * This value MUST be consistant across all processes accessing the + * file. This field is ignored unless HDF5 has been compiled for + * parallel. * * metadata_write_strategy: Integer field containing a code indicating the - * desired metadata write strategy. The valid values of this field - * are enumerated and discussed below: + * desired metadata write strategy. The valid values of this field + * are enumerated and discussed below: * * - * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: + * H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY: * - * When metadata_write_strategy is set to this value, only process - * zero is allowed to write dirty metadata to disk. All other - * processes must retain dirty metadata until they are informed at - * a sync point that the dirty metadata in question has been written - * to disk. + * When metadata_write_strategy is set to this value, only process + * zero is allowed to write dirty metadata to disk. All other + * processes must retain dirty metadata until they are informed at + * a sync point that the dirty metadata in question has been written + * to disk. * - * When the sync point is reached (or when there is a user generated - * flush), process zero flushes sufficient entries to bring it into - * complience with its min clean size (or flushes all dirty entries in - * the case of a user generated flush), broad casts the list of - * entries just cleaned to all the other processes, and then exits - * the sync point. + * When the sync point is reached (or when there is a user generated + * flush), process zero flushes sufficient entries to bring it into + * complience with its min clean size (or flushes all dirty entries in + * the case of a user generated flush), broad casts the list of + * entries just cleaned to all the other processes, and then exits + * the sync point. * - * Upon receipt of the broadcast, the other processes mark the indicated - * entries as clean, and leave the sync point as well. + * Upon receipt of the broadcast, the other processes mark the indicated + * entries as clean, and leave the sync point as well. * * - * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: + * H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED: * - * In the distributed metadata write strategy, process zero still makes - * the decisions as to what entries should be flushed, but the actual - * flushes are distributed across the processes in the computation to - * the extent possible. + * In the distributed metadata write strategy, process zero still makes + * the decisions as to what entries should be flushed, but the actual + * flushes are distributed across the processes in the computation to + * the extent possible. * - * In this strategy, when a sync point is triggered (either by dirty - * metadata creation or manual flush), all processes enter a barrier. + * In this strategy, when a sync point is triggered (either by dirty + * metadata creation or manual flush), all processes enter a barrier. * - * On the other side of the barrier, process 0 constructs an ordered - * list of the entries to be flushed, and then broadcasts this list - * to the caches in all the processes. + * On the other side of the barrier, process 0 constructs an ordered + * list of the entries to be flushed, and then broadcasts this list + * to the caches in all the processes. * - * All processes then scan the list of entries to be flushed, flushing - * some, and marking the rest as clean. The algorithm for this purpose - * ensures that each entry in the list is flushed exactly once, and - * all are marked clean in each cache. + * All processes then scan the list of entries to be flushed, flushing + * some, and marking the rest as clean. The algorithm for this purpose + * ensures that each entry in the list is flushed exactly once, and + * all are marked clean in each cache. * - * Note that in the case of a flush of the cache, no message passing - * is necessary, as all processes have the same list of dirty entries, - * and all of these entries must be flushed. Thus in this case it is - * sufficient for each process to sort its list of dirty entries after - * leaving the initial barrier, and use this list as if it had been - * received from process zero. + * Note that in the case of a flush of the cache, no message passing + * is necessary, as all processes have the same list of dirty entries, + * and all of these entries must be flushed. Thus in this case it is + * sufficient for each process to sort its list of dirty entries after + * leaving the initial barrier, and use this list as if it had been + * received from process zero. + * + * To avoid possible messages from the past/future, all caches must + * wait until all caches are done before leaving the sync point. * - * To avoid possible messages from the past/future, all caches must - * wait until all caches are done before leaving the sync point. - * ****************************************************************************/ -#define H5AC__CURR_CACHE_CONFIG_VERSION 1 -#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 +#define H5AC__CURR_CACHE_CONFIG_VERSION 1 +#define H5AC__MAX_TRACE_FILE_NAME_LEN 1024 #define H5AC_METADATA_WRITE_STRATEGY__PROCESS_0_ONLY 0 #define H5AC_METADATA_WRITE_STRATEGY__DISTRIBUTED 1 @@ -451,9 +451,9 @@ typedef struct H5AC_cache_config_t /* general configuration fields: */ int version; - hbool_t rpt_fcn_enabled; + hbool_t rpt_fcn_enabled; - hbool_t open_trace_file; + hbool_t open_trace_file; hbool_t close_trace_file; char trace_file_name[H5AC__MAX_TRACE_FILE_NAME_LEN + 1]; @@ -512,7 +512,7 @@ typedef struct H5AC_cache_config_t * * structure H5AC_cache_image_config_t * - * H5AC_cache_image_ctl_t is a public structure intended for use in public + * H5AC_cache_image_ctl_t is a public structure intended for use in public * APIs. At least in its initial incarnation, it is a copy of struct * H5C_cache_image_ctl_t. * @@ -526,47 +526,47 @@ typedef struct H5AC_cache_config_t * generate_image: Boolean flag indicating whether a cache image should * be created on file close. * - * save_resize_status: Boolean flag indicating whether the cache image - * should include the adaptive cache resize configuration and status. - * Note that this field is ignored at present. + * save_resize_status: Boolean flag indicating whether the cache image + * should include the adaptive cache resize configuration and status. + * Note that this field is ignored at present. * - * entry_ageout: Integer field indicating the maximum number of - * times a prefetched entry can appear in subsequent cache images. - * This field exists to allow the user to avoid the buildup of - * infrequently used entries in long sequences of cache images. + * entry_ageout: Integer field indicating the maximum number of + * times a prefetched entry can appear in subsequent cache images. + * This field exists to allow the user to avoid the buildup of + * infrequently used entries in long sequences of cache images. * - * The value of this field must lie in the range - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). + * The value of this field must lie in the range + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE (-1) to + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX (100). * - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit - * is imposed on number of times a prefeteched entry can appear - * in subsequent cache images. + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE means that no limit + * is imposed on number of times a prefeteched entry can appear + * in subsequent cache images. * - * A value of 0 prevents prefetched entries from being included - * in cache images. + * A value of 0 prevents prefetched entries from being included + * in cache images. * - * Positive integers restrict prefetched entries to the specified - * number of appearances. + * Positive integers restrict prefetched entries to the specified + * number of appearances. * - * Note that the number of subsequent cache images that a prefetched - * entry has appeared in is tracked in an 8 bit field. Thus, while - * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its - * current value, any value in excess of 255 will be the functional - * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. + * Note that the number of subsequent cache images that a prefetched + * entry has appeared in is tracked in an 8 bit field. Thus, while + * H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX can be increased from its + * current value, any value in excess of 255 will be the functional + * equivalent of H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE. * ****************************************************************************/ -#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 +#define H5AC__CURR_CACHE_IMAGE_CONFIG_VERSION 1 -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 -#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__NONE -1 +#define H5AC__CACHE_IMAGE__ENTRY_AGEOUT__MAX 100 typedef struct H5AC_cache_image_config_t { - int32_t version; + int version; hbool_t generate_image; hbool_t save_resize_status; - int32_t entry_ageout; + int entry_ageout; } H5AC_cache_image_config_t; #ifdef __cplusplus -- cgit v0.12 From 7c5a425360d17aa02a9bed31a396e954a9dda898 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 13:19:20 -0500 Subject: ignore java classpath --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7424325..3caf16a 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,4 @@ src/H5config.h.in src/H5overflow.h src/H5version.h +/.classpath -- cgit v0.12 From e718e2ab319d398ed28d39e6119e9a128990311e Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 17 Apr 2017 13:51:45 -0500 Subject: HDFFV-10170 fix command syntax --- test/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/Makefile.am b/test/Makefile.am index 7d4fc7c..49b251a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -106,7 +106,7 @@ if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + noinst_LTLIBRARIES+=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c -- cgit v0.12 From 32b8d5ffc897adae1507c5552383ca25dc6a83b8 Mon Sep 17 00:00:00 2001 From: "M. Scot Breitenfeld" Date: Tue, 18 Apr 2017 09:21:36 -0500 Subject: added point to build script repo. --- release_docs/INSTALL_parallel | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/release_docs/INSTALL_parallel b/release_docs/INSTALL_parallel index e4c540c..5a8b603 100644 --- a/release_docs/INSTALL_parallel +++ b/release_docs/INSTALL_parallel @@ -1,6 +1,18 @@ Installation instructions for Parallel HDF5 ------------------------------------------- +0. Use Build Scripts +-------------------- +The HDF Group is accumulating build scripts to handle building parallel HDF5 +on various platforms (Cray, IBM, SGI, etc...). These scripts are being +maintained and updated continuously for current and future systems. The reader +is strongly encouraged to consult the repository at, + +https://github.com/HDFGroup/build_hdf5 + +for building parallel HDF5 on these system. All contributions, additions +and fixes to the repository are welcomed and encouraged. + 1. Overview ----------- -- cgit v0.12 From 9b234d74bb99c8656b5bee137a37edd35d3a6c9a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 10:38:14 -0500 Subject: Add plugin options for libs --- java/src/jni/Makefile.am | 2 +- test/Makefile.am | 4 ++++ tools/test/h5dump/Makefile.am | 4 ++-- tools/test/h5repack/Makefile.am | 3 ++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index 4667407..cf627ef 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS= -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ diff --git a/test/Makefile.am b/test/Makefile.am index 49b251a..376291a 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -111,6 +111,10 @@ if HAVE_SHARED_CONDITIONAL libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c libdynlib4_la_SOURCES=dynlib4.c + libdynlib1_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib2_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic else # The libh5test library provides common support code for the tests. diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index a3d1df7..6d8205d 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,9 +41,9 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - lib_LTLIBRARIES=libdynlibdump.la + noinst_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c - + libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index 22c6d96..a15f4a6 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -50,7 +50,8 @@ if HAVE_SHARED_CONDITIONAL noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c - + libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 0b226bd28beb02165f18a9e3fdc985028ce37946 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 11:04:22 -0500 Subject: HDFFV-10170 undo patch --- test/Makefile.am | 13 ++++++------- tools/test/h5dump/Makefile.am | 3 ++- tools/test/h5repack/Makefile.am | 5 ++++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/test/Makefile.am b/test/Makefile.am index 376291a..79dc17f 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -100,13 +100,13 @@ if BUILD_ALL_CONDITIONAL noinst_PROGRAMS=$(BUILD_ALL_PROGS) endif -if HAVE_SHARED_CONDITIONAL - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +# The libh5test library provides common support code for the tests. +noinst_LTLIBRARIES=libh5test.la +if HAVE_SHARED_CONDITIONAL # The libdynlib1, libdynlib2, libdynlib3, and libdynlib4 library for testing plugin module plugin.c. # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES+=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la + lib_LTLIBRARIES=libdynlib1.la libdynlib2.la libdynlib3.la libdynlib4.la libdynlib1_la_SOURCES=dynlib1.c libdynlib2_la_SOURCES=dynlib2.c libdynlib3_la_SOURCES=dynlib3.c @@ -116,9 +116,8 @@ if HAVE_SHARED_CONDITIONAL libdynlib3_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlib4_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -else - # The libh5test library provides common support code for the tests. - noinst_LTLIBRARIES=libh5test.la +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c diff --git a/tools/test/h5dump/Makefile.am b/tools/test/h5dump/Makefile.am index 6d8205d..8723c65 100644 --- a/tools/test/h5dump/Makefile.am +++ b/tools/test/h5dump/Makefile.am @@ -41,9 +41,10 @@ LDADD=$(LIBH5TOOLS) $(LIBHDF5) if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlibdump.la + lib_LTLIBRARIES=libdynlibdump.la libdynlibdump_la_SOURCES=dynlib_dump.c libdynlibdump_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* endif diff --git a/tools/test/h5repack/Makefile.am b/tools/test/h5repack/Makefile.am index a15f4a6..375df47 100644 --- a/tools/test/h5repack/Makefile.am +++ b/tools/test/h5repack/Makefile.am @@ -47,11 +47,14 @@ h5repacktst_SOURCES=h5repacktst.c if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. - noinst_LTLIBRARIES=libdynlibadd.la libdynlibvers.la + lib_LTLIBRARIES=libdynlibadd.la libdynlibvers.la libdynlibadd_la_SOURCES=dynlib_rpk.c libdynlibvers_la_SOURCES=dynlib_vrpk.c libdynlibadd_la_LDFLAGS = -avoid-version -module -shared -export-dynamic libdynlibvers_la_LDFLAGS = -avoid-version -module -shared -export-dynamic + +install-exec-hook: + $(RM) $(DESTDIR)$(libdir)/*dynlib* endif # Temporary files. *.h5 are generated by h5repack. They should -- cgit v0.12 From 5bbaae4495eb6f2eea309e886bccbc6051b6f534 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 11:44:47 -0500 Subject: java jni lib also needs to avoid the version-info --- java/src/jni/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index cf627ef..5672864 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS = -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ -- cgit v0.12 From b7aeefbbc95bb44ee293760461d716d4b5fc0df3 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Tue, 18 Apr 2017 13:24:00 -0500 Subject: Fix for DAILYTEST-259 h5clear test failure Deposit the test files in test/misc/testfiles for testh5clear.sh to use instead of depending on h5clear_gentest. Tested on kituo, osx1010test, quail, platypus and ostrich. --- MANIFEST | 11 ++- tools/test/misc/testfiles/h5clear_log_v3.h5 | Bin 0 -> 2048 bytes tools/test/misc/testfiles/h5clear_mdc_image.h5 | Bin 0 -> 23467 bytes tools/test/misc/testfiles/h5clear_sec2_v0.h5 | Bin 0 -> 800 bytes tools/test/misc/testfiles/h5clear_sec2_v2.h5 | Bin 0 -> 830 bytes tools/test/misc/testfiles/h5clear_sec2_v3.h5 | Bin 0 -> 195 bytes tools/test/misc/testfiles/latest_h5clear_log_v3.h5 | Bin 0 -> 2048 bytes .../test/misc/testfiles/latest_h5clear_sec2_v3.h5 | Bin 0 -> 195 bytes tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 | Bin 22048 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 | Bin 800 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 | Bin 830 -> 0 bytes tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 | Bin 195 -> 0 bytes tools/test/misc/testh5clear.sh.in | 84 +++++++++++---------- 13 files changed, 51 insertions(+), 44 deletions(-) create mode 100644 tools/test/misc/testfiles/h5clear_log_v3.h5 create mode 100644 tools/test/misc/testfiles/h5clear_mdc_image.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v0.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v2.h5 create mode 100644 tools/test/misc/testfiles/h5clear_sec2_v3.h5 create mode 100644 tools/test/misc/testfiles/latest_h5clear_log_v3.h5 create mode 100644 tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 delete mode 100644 tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 delete mode 100644 tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 diff --git a/MANIFEST b/MANIFEST index 5710f6c..5f549f4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1471,10 +1471,13 @@ ./tools/test/misc/testfiles/h5clear_no_mdc_image.ddl ./tools/test/misc/testfiles/h5clear_open_fail.ddl ./tools/test/misc/testfiles/h5clear_usage.ddl -./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 -./tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/h5clear_log_v3.h5 +./tools/test/misc/testfiles/h5clear_mdc_image.h5 +./tools/test/misc/testfiles/h5clear_sec2_v0.h5 +./tools/test/misc/testfiles/h5clear_sec2_v2.h5 +./tools/test/misc/testfiles/h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/latest_h5clear_log_v3.h5 +./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 ./tools/test/misc/testfiles/h5mkgrp_help.txt ./tools/test/misc/testfiles/h5mkgrp_version.txt.in ./tools/test/misc/h5perf_gentest.c diff --git a/tools/test/misc/testfiles/h5clear_log_v3.h5 b/tools/test/misc/testfiles/h5clear_log_v3.h5 new file mode 100644 index 0000000..aed33a4 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_log_v3.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_mdc_image.h5 b/tools/test/misc/testfiles/h5clear_mdc_image.h5 new file mode 100644 index 0000000..6ed8b70 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_mdc_image.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v0.h5 b/tools/test/misc/testfiles/h5clear_sec2_v0.h5 new file mode 100644 index 0000000..571fd46 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v0.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v2.h5 b/tools/test/misc/testfiles/h5clear_sec2_v2.h5 new file mode 100644 index 0000000..92833e6 Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v2.h5 differ diff --git a/tools/test/misc/testfiles/h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/h5clear_sec2_v3.h5 new file mode 100644 index 0000000..9f1e6ce Binary files /dev/null and b/tools/test/misc/testfiles/h5clear_sec2_v3.h5 differ diff --git a/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 b/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 new file mode 100644 index 0000000..da5c426 Binary files /dev/null and b/tools/test/misc/testfiles/latest_h5clear_log_v3.h5 differ diff --git a/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 new file mode 100644 index 0000000..e511248 Binary files /dev/null and b/tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 differ diff --git a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 deleted file mode 100644 index 310134b..0000000 Binary files a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 deleted file mode 100644 index 571fd46..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v0.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 deleted file mode 100644 index 92833e6..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v2.h5 and /dev/null differ diff --git a/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 b/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 deleted file mode 100644 index 9f1e6ce..0000000 Binary files a/tools/test/misc/testfiles/orig_h5clear_sec2_v3.h5 and /dev/null differ diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index 71d5cad..a31b824 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -68,10 +68,13 @@ $SRC_H5CLEAR_TESTFILES/h5clear_usage.ddl $SRC_H5CLEAR_TESTFILES/h5clear_open_fail.ddl $SRC_H5CLEAR_TESTFILES/h5clear_missing_file.ddl $SRC_H5CLEAR_TESTFILES/h5clear_no_mdc_image.ddl -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v0.h5 -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v2.h5 -$SRC_H5CLEAR_TESTFILES/orig_h5clear_sec2_v3.h5 -$SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v0.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v2.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_sec2_v3.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_log_v3.h5 +$SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5 +$SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5 +$SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -121,8 +124,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-74 | tr -d '\012' } # $1 is the expected output @@ -226,29 +229,27 @@ COPY_TESTFILES_TO_TESTDIR # "h5clear -h" # "h5clear" (no options, no file) # "h5clear junk.h5" (no options, nonexisting file) -# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear h5clear_sec2_v3.h5" (no options, existing file) # "h5clear -m" (valid 1 option, no file) # "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s junk.h5" (valid 2 options, no file) +# "h5clear -m -s" (valid 2 options, no file) # "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear -m h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) TOOLTEST_OUT "" -h "" h5clear_usage.ddl TOOLTEST_OUT "" "" "" h5clear_usage.ddl TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the expected exit code from h5clear: -# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) -# "h5clear --vers" (valid option, version #, succeed exit code) # "h5clear -k" (invalid 1 option, no file, fail exit code) # "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code) # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) @@ -258,52 +259,55 @@ TOOLTEST_OUT $TESTDIR/orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) # "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) -TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED -TOOLTEST "" --vers "" $SUCCEED TOOLTEST "" -k "" $FAIL TOOLTEST junk.h5 -k "" $FAIL TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL TOOLTEST "" -m -k $FAIL TOOLTEST "" -l -m $FAIL -TOOLTEST junk.h5 -m -l $FAIL +TOOLTEST junk.h5 -m -k $FAIL TOOLTEST junk.h5 -l -m $FAIL -TOOLTEST h5clear_sec2_v0.h5 -m -l $FAIL -TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -m -k $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -l -m $FAIL +# +# "h5clear --vers" (valid option, version #, succeed exit code) +# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) +TOOLTEST "" --vers "" $SUCCEED +TOOLTEST $TESTDIR/h5clear_mdc_image.h5 -m "" $SUCCEED # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: -TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the status_flags field is cleared properly: -OPEN_CHK h5clear_sec2_v3.h5 $FAIL -TOOLTEST h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $FAIL +TOOLTEST $TESTDIR/h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK h5clear_log_v3.h5 $FAIL -TOOLTEST h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK h5clear_log_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $FAIL +TOOLTEST $TESTDIR/h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $SUCCEED # -OPEN_CHK latest_h5clear_sec2_v3.h5 $FAIL -TOOLTEST latest_h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK latest_h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $FAIL +TOOLTEST $TESTDIR/latest_h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK latest_h5clear_log_v3.h5 $FAIL -TOOLTEST latest_h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK latest_h5clear_log_v3.h5 $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $FAIL +TOOLTEST $TESTDIR/latest_h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $SUCCEED # # File open succeeds for the following 2 test files because the # library does not check status_flags for files with < v3 superblock: -OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED -TOOLTEST h5clear_sec2_v0.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED +TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED # -OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED -TOOLTEST h5clear_sec2_v2.h5 -s "" $SUCCEED -OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED +TOOLTEST $TESTDIR/h5clear_sec2_v2.h5 -s "" $SUCCEED +OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED # # # -- cgit v0.12 From 9f1fd68ce2918f9d67a5b93ffa3dee35d21f5848 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 13:27:54 -0500 Subject: LDFLAGS module forces .so lib to be built on osx instead of .dylib --- java/src/jni/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/jni/Makefile.am b/java/src/jni/Makefile.am index 5672864..fdf6608 100644 --- a/java/src/jni/Makefile.am +++ b/java/src/jni/Makefile.am @@ -31,7 +31,7 @@ AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_srcdir)/java/src/jni $(JNIFLAGS) lib_LTLIBRARIES=libhdf5_java.la # Add libtool numbers to the HDF5 Java (JNI) library (from config/lt_vers.am) -libhdf5_java_la_LDFLAGS = -avoid-version -module -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) +libhdf5_java_la_LDFLAGS = -avoid-version -shared -export-dynamic -version-info $(LT_JAVA_VERS_INTERFACE):$(LT_JAVA_VERS_REVISION):$(LT_JAVA_VERS_AGE) $(AM_LDFLAGS) # Source files for the library libhdf5_java_la_SOURCES=exceptionImp.c h5Constants.c nativeData.c h5util.c h5Imp.c \ -- cgit v0.12 From 62770c64326f844739c2753bfee49c297f2c7a39 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Tue, 18 Apr 2017 14:23:35 -0500 Subject: Update tool dyn lib --- tools/test/h5diff/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5diff/Makefile.am b/tools/test/h5diff/Makefile.am index 1d700ea..16897c6 100644 --- a/tools/test/h5diff/Makefile.am +++ b/tools/test/h5diff/Makefile.am @@ -54,6 +54,7 @@ if HAVE_SHARED_CONDITIONAL # Build it as shared library if configure is enabled for shared library. lib_LTLIBRARIES=libdynlibdiff.la libdynlibdiff_la_SOURCES=dynlib_diff.c + libdynlibdiff_la_LDFLAGS = -avoid-version -module -shared -export-dynamic install-exec-hook: $(RM) $(DESTDIR)$(libdir)/*dynlib* -- cgit v0.12 From d594cb2cc6d73ef2dd7ddfee689cdda23827e03e Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Wed, 19 Apr 2017 18:28:21 -0400 Subject: Added code to disable the evict-on-close feature in the parallel library. --- src/H5Pfapl.c | 21 ++++++++++- test/cache_image.c | 8 ++++ test/evict_on_close.c | 100 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 127 insertions(+), 2 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 7865fdf..8bd53a9 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4381,7 +4381,19 @@ H5P_facc_mdc_log_location_close(const char H5_ATTR_UNUSED *name, size_t H5_ATTR_ *------------------------------------------------------------------------- */ herr_t -H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) +H5Pset_evict_on_close( +#if defined(H5_HAVE_PARALLEL) && !defined(H5_DEBUG_BUILD) + hid_t H5_ATTR_UNUSED fapl_id, +#else + hid_t fapl_id, +#endif /* H5_HAVE_PARALLEL and !H5_DEBUG_BUILD */ + +#ifdef H5_HAVE_PARALLEL + hbool_t H5_ATTR_UNUSED evict_on_close +#else + hbool_t evict_on_close +#endif /* H5_HAVE_PARALLEL */ +) { H5P_genplist_t *plist; /* property list pointer */ herr_t ret_value = SUCCEED; /* return value */ @@ -4389,6 +4401,7 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", fapl_id, evict_on_close); + /* Compare the property list's class against the other class */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist") @@ -4397,9 +4410,13 @@ H5Pset_evict_on_close(hid_t fapl_id, hbool_t evict_on_close) if(NULL == (plist = (H5P_genplist_t *)H5I_object(fapl_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID") - /* Set values */ +#ifndef H5_HAVE_PARALLEL + /* Set value */ if(H5P_set(plist, H5F_ACS_EVICT_ON_CLOSE_FLAG_NAME, &evict_on_close) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set evict on close property") +#else + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "evict on close is currently not supported in parallel HDF5") +#endif /* H5_HAVE_PARALLEL */ done: FUNC_LEAVE_API(ret_value) diff --git a/test/cache_image.c b/test/cache_image.c index dfbd02e..31d7705 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -62,7 +62,10 @@ static unsigned cache_image_api_error_check_3(void); static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); + +#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void); +#endif /* H5_HAVE_PARALLEL */ /****************************************************************************/ @@ -7711,6 +7714,7 @@ get_free_sections_test(void) * *------------------------------------------------------------------------- */ +#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void) { @@ -8015,6 +8019,7 @@ evict_on_close_test(void) return !pass; } /* evict_on_close_test() */ +#endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- @@ -8066,7 +8071,10 @@ main(void) nerrs += cache_image_api_error_check_4(); nerrs += get_free_sections_test(); + +#ifndef H5_HAVE_PARALLEL nerrs += evict_on_close_test(); +#endif /* H5_HAVE_PARALLEL */ return(nerrs > 0); diff --git a/test/evict_on_close.c b/test/evict_on_close.c index b00c1e4..8196ea1 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -39,6 +39,12 @@ #include "H5Gpkg.h" #include "H5Ipkg.h" +/* Evict on close is not supported under parallel at this time. + * In the meantime, we just run a simple check that EoC can't be + * enabled in parallel HDF5. + */ +#ifndef H5_HAVE_PARALLEL + /* Uncomment to manually inspect cache states */ /* (Requires debug build of the library) */ /* #define EOC_MANUAL_INSPECTION */ @@ -802,6 +808,7 @@ error: } /* check_dset_scheme() */ + /*------------------------------------------------------------------------- * Function: check_evict_on_close_api() @@ -992,3 +999,96 @@ error: } /* end main() */ +#else + + +/*------------------------------------------------------------------------- + * Function: check_evict_on_close_parallel_fail() + * + * Purpose: Verify that the H5Pset_evict_on_close() call fails in + * parallel HDF5. + * + * Return: SUCCEED/FAIL + * + * Programmer: Dana Robinson + * Spring 2017 + * + *------------------------------------------------------------------------- + */ +static herr_t +check_evict_on_close_parallel_fail(void) +{ + hid_t fapl_id = -1; + hbool_t evict_on_close; + herr_t status; + + TESTING("evict on close fails in parallel"); + + /* Create a fapl */ + if((fapl_id = H5Pcreate(H5P_FILE_ACCESS)) < 0) + TEST_ERROR; + + /* Set the evict on close property (should fail)*/ + evict_on_close = TRUE; + H5E_BEGIN_TRY { + status = H5Pset_evict_on_close(fapl_id, evict_on_close); + } H5E_END_TRY; + if(status >= 0) + FAIL_PUTS_ERROR("H5Pset_evict_on_close() did not fail in parallel HDF5."); + + /* close fapl */ + if(H5Pclose(fapl_id) < 0) + TEST_ERROR; + + PASSED(); + return SUCCEED; + +error: + H5_FAILED(); + return FAIL; + +} /* check_evict_on_close_parallel_fail() */ + + +/*------------------------------------------------------------------------- + * Function: main (parallel version) + * + * Return: EXIT_FAILURE/EXIT_SUCCESS + * + * Programmer: Dana Robinson + * Spring 2016 + * + *------------------------------------------------------------------------- + */ +int +main(void) +{ + unsigned nerrors = 0; /* number of test errors */ + + HDprintf("Testing evict-on-close cache behavior\n"); + + /* Initialize */ + h5_reset(); + + /* Test that EoC fails in parallel HDF5 */ + nerrors += check_evict_on_close_parallel_fail() < 0 ? 1 : 0; + + if(nerrors) + goto error; + + HDprintf("All evict-on-close tests passed.\n"); + HDprintf("Note that EoC is not supported under parallel so most tests are skipped.\n"); + + return EXIT_SUCCESS; + +error: + + HDprintf("***** %u evict-on-close test%s FAILED! *****\n", + nerrors, nerrors > 1 ? "S" : ""); + + return EXIT_FAILURE; + +} /* main() - parallel */ + +#endif /* H5_HAVE_PARALLEL */ + -- cgit v0.12 From 43e03c548ae2c405b92f95833251683d3eeb1440 Mon Sep 17 00:00:00 2001 From: Vailin Choi Date: Wed, 19 Apr 2017 22:51:39 -0500 Subject: Modifications based on review comments from pull request. Made changes according to review comments and discussion with Allen. --- MANIFEST | 1 + tools/test/misc/h5clear_gentest.c | 118 ++++++++++----------- tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 | Bin 0 -> 22048 bytes tools/test/misc/testh5clear.sh.in | 104 ++++++++++-------- 4 files changed, 117 insertions(+), 106 deletions(-) create mode 100644 tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 diff --git a/MANIFEST b/MANIFEST index 5f549f4..27781b8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1478,6 +1478,7 @@ ./tools/test/misc/testfiles/h5clear_sec2_v3.h5 ./tools/test/misc/testfiles/latest_h5clear_log_v3.h5 ./tools/test/misc/testfiles/latest_h5clear_sec2_v3.h5 +./tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 ./tools/test/misc/testfiles/h5mkgrp_help.txt ./tools/test/misc/testfiles/h5mkgrp_version.txt.in ./tools/test/misc/h5perf_gentest.c diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index f8b6a70..86ea3d2 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -142,7 +142,7 @@ error: * status_flags properly so users can open the files afterwards. * * Return: Success: 0 - * Failure: 1 + * Failure: 1 * * Programmer: Vailin Choi; July 2013 * @@ -167,65 +167,65 @@ main(void) /* Create a copy of the file access property list */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) - goto error; + goto error; /* Copy the file access property list */ if((new_fapl = H5Pcopy(fapl)) < 0) - goto error; + goto error; /* Set to latest library format */ if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) - goto error; + goto error; /* Files created within this for loop will have v3 superblock and nonzero status_flags */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t fapl2, my_fapl; /* File access property lists */ - - /* Set to use the appropriate file access property list */ - if(new_format) - fapl2 = new_fapl; - else - fapl2 = fapl; - /* - * Create a sec2 file - */ - if((my_fapl = H5Pcopy(fapl2)) < 0) - goto error; - /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) - goto error; - - /* Flush the file */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + hid_t fapl2, my_fapl; /* File access property lists */ + + /* Set to use the appropriate file access property list */ + if(new_format) + fapl2 = new_fapl; + else + fapl2 = fapl; + /* + * Create a sec2 file + */ + if((my_fapl = H5Pcopy(fapl2)) < 0) + goto error; + /* Create the file */ + sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + goto error; + + /* Flush the file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + goto error; - /* Close the property list */ - if(H5Pclose(my_fapl) < 0) - goto error; - - /* - * Create a log file - */ - /* Create a copy of file access property list */ - if((my_fapl = H5Pcopy(fapl2)) < 0) - goto error; - - /* Setup the fapl for the log driver */ - if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0) - goto error; - - /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) - goto error; - - /* Flush the file */ - if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; - - /* Close the property list */ - if(H5Pclose(my_fapl) < 0) - goto error; + /* Close the property list */ + if(H5Pclose(my_fapl) < 0) + goto error; + + /* + * Create a log file + */ + /* Create a copy of file access property list */ + if((my_fapl = H5Pcopy(fapl2)) < 0) + goto error; + + /* Setup the fapl for the log driver */ + if(H5Pset_fapl_log(my_fapl, "append.log", (unsigned long long)H5FD_LOG_ALL, (size_t)(4 * KB)) < 0) + goto error; + + /* Create the file */ + sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + goto error; + + /* Flush the file */ + if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) + goto error; + + /* Close the property list */ + if(H5Pclose(my_fapl) < 0) + goto error; } /* end for */ @@ -233,38 +233,38 @@ main(void) * Create a sec2 file with v0 superblock but nonzero status_flags */ if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) - goto error; + goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + goto error; /* * Create a sec2 file with v2 superblock but nonzero status_flags */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) - goto error; + goto error; if(H5Pset_shared_mesg_nindexes(fcpl, 1) < 0) goto error; if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0) goto error; if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0) - goto error; + goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) - goto error; + goto error; /* Close the property lists */ if(H5Pclose(fapl) < 0) - goto error; + goto error; if(H5Pclose(new_fapl) < 0) - goto error; + goto error; if(H5Pclose(fcpl) < 0) - goto error; + goto error; fflush(stdout); fflush(stderr); diff --git a/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 new file mode 100644 index 0000000..310134b Binary files /dev/null and b/tools/test/misc/testfiles/mod_h5clear_mdc_image.h5 differ diff --git a/tools/test/misc/testh5clear.sh.in b/tools/test/misc/testh5clear.sh.in index a31b824..b855572 100644 --- a/tools/test/misc/testh5clear.sh.in +++ b/tools/test/misc/testh5clear.sh.in @@ -75,6 +75,7 @@ $SRC_H5CLEAR_TESTFILES/h5clear_log_v3.h5 $SRC_H5CLEAR_TESTFILES/latest_h5clear_log_v3.h5 $SRC_H5CLEAR_TESTFILES/latest_h5clear_sec2_v3.h5 $SRC_H5CLEAR_TESTFILES/h5clear_mdc_image.h5 +$SRC_H5CLEAR_TESTFILES/mod_h5clear_mdc_image.h5 " COPY_TESTFILES_TO_TESTDIR() @@ -124,8 +125,8 @@ CLEAN_TESTFILES_AND_TESTDIR() # beginning with the word "Testing". # TESTING() { - SPACES=" " - echo "Testing $* $SPACES" | cut -c1-74 | tr -d '\012' + SPACES=" " + echo "Testing $* $SPACES" | cut -c1-70 | tr -d '\012' } # $1 is the expected output @@ -164,6 +165,7 @@ TOOLTEST_OUT() { # Run test. TESTING $H5CLEAR $option1 $option2 $fname ( + cd $TESTDIR $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname ) >$actual 2>$actual_err cp $actual $actual_sav @@ -184,7 +186,10 @@ TOOLTEST_OUT() { OPEN_CHK() { fname=$1 expected=$2 - $OPENCHK_BIN $fname 2>/dev/null + ( + cd $TESTDIR + $OPENCHK_BIN $fname 2>/dev/null + ) actual=$? if test $actual -ne $expected; then echo "Unexpected return from $OPENCHK" @@ -204,9 +209,11 @@ TOOLTEST() { ret_expected=$4 # TESTING $H5CLEAR $option1 $option2 $fname - fname=$1 # h5clear $option1 $option2 $fname - $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null + ( + cd $TESTDIR + $RUNSERIAL $H5CLEAR_BIN $option1 $option2 $fname 2>/dev/null 1>/dev/null + ) if test $? -ne $ret_expected; then echo "*FAILED*" nerrors=`expr $nerrors + 1` @@ -222,92 +229,95 @@ TOOLTEST() { ############################################################################## # prepare for testing COPY_TESTFILES_TO_TESTDIR +# For Cmake +$CP -f $TESTDIR/h5clear_sec2_v0.h5 $TESTDIR/orig_h5clear_sec2_v0.h5 +$CP -f $TESTDIR/h5clear_sec2_v2.h5 $TESTDIR/orig_h5clear_sec2_v2.h5 +$CP -f $TESTDIR/h5clear_sec2_v3.h5 $TESTDIR/orig_h5clear_sec2_v3.h5 # # # # The following are tests to verify the expected output from h5clear # "h5clear -h" -# "h5clear" (no options, no file) -# "h5clear junk.h5" (no options, nonexisting file) -# "h5clear h5clear_sec2_v3.h5" (no options, existing file) -# "h5clear -m" (valid 1 option, no file) -# "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s" (valid 2 options, no file) -# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear" (no options, no file) +# "h5clear junk.h5" (no options, nonexisting file) +# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear -m" (valid 1 option, no file) +# "h5clear -s junk.h5" (valid 1 option, nonexisting file) +# "h5clear -m -s" (valid 2 options, no file) +# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) +# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) TOOLTEST_OUT "" -h "" h5clear_usage.ddl TOOLTEST_OUT "" "" "" h5clear_usage.ddl TOOLTEST_OUT junk.h5 "" "" h5clear_usage.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl +TOOLTEST_OUT orig_h5clear_sec2_v3.h5 "" "" h5clear_usage.ddl TOOLTEST_OUT "" -m "" h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -s "" h5clear_open_fail.ddl TOOLTEST_OUT "" -m -s h5clear_missing_file.ddl TOOLTEST_OUT junk.h5 -m -s h5clear_open_fail.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT orig_h5clear_sec2_v2.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT orig_h5clear_sec2_v0.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the expected exit code from h5clear: +# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) +# "h5clear --vers" (valid option, version #, succeed exit code) # "h5clear -k" (invalid 1 option, no file, fail exit code) # "h5clear -k junk.h5" (invalid 1 option, nonexisting file, fail exit code) # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) # "h5clear -m -k" (valid/invalid 2 options, nofile, fail exit code) # "h5clear -l -m" (invalid/valid 2 options, nofile, fail exit code) -# "h5clear -m -k junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) +# "h5clear -m -l junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) -# "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) +# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) +TOOLTEST h5clear_mdc_image.h5 -m "" $SUCCEED +TOOLTEST "" --vers "" $SUCCEED TOOLTEST "" -k "" $FAIL TOOLTEST junk.h5 -k "" $FAIL TOOLTEST h5clear_sec2_v2.h5 -l "" $FAIL TOOLTEST "" -m -k $FAIL TOOLTEST "" -l -m $FAIL -TOOLTEST junk.h5 -m -k $FAIL +TOOLTEST junk.h5 -m -l $FAIL TOOLTEST junk.h5 -l -m $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -m -k $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -l -m $FAIL -# -# "h5clear --vers" (valid option, version #, succeed exit code) -# "h5clear -m h5clear_mdc_image.h5" (valid option, existing file, succeed exit code) -TOOLTEST "" --vers "" $SUCCEED -TOOLTEST $TESTDIR/h5clear_mdc_image.h5 -m "" $SUCCEED +TOOLTEST h5clear_sec2_v0.h5 -m -l $FAIL +TOOLTEST h5clear_sec2_v0.h5 -l -m $FAIL # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: -TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl -TOOLTEST_OUT $TESTDIR/h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -m "" h5clear_no_mdc_image.ddl +TOOLTEST_OUT mod_h5clear_mdc_image.h5 -s -m h5clear_no_mdc_image.ddl # # # # The following are tests to verify the status_flags field is cleared properly: -OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $FAIL -TOOLTEST $TESTDIR/h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v3.h5 $FAIL +TOOLTEST h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $FAIL -TOOLTEST $TESTDIR/h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_log_v3.h5 $SUCCEED +OPEN_CHK h5clear_log_v3.h5 $FAIL +TOOLTEST h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK h5clear_log_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $FAIL -TOOLTEST $TESTDIR/latest_h5clear_sec2_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/latest_h5clear_sec2_v3.h5 $SUCCEED +OPEN_CHK latest_h5clear_sec2_v3.h5 $FAIL +TOOLTEST latest_h5clear_sec2_v3.h5 -s "" $SUCCEED +OPEN_CHK latest_h5clear_sec2_v3.h5 $SUCCEED # -OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $FAIL -TOOLTEST $TESTDIR/latest_h5clear_log_v3.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/latest_h5clear_log_v3.h5 $SUCCEED +OPEN_CHK latest_h5clear_log_v3.h5 $FAIL +TOOLTEST latest_h5clear_log_v3.h5 -s "" $SUCCEED +OPEN_CHK latest_h5clear_log_v3.h5 $SUCCEED # # File open succeeds for the following 2 test files because the # library does not check status_flags for files with < v3 superblock: -OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED -TOOLTEST $TESTDIR/h5clear_sec2_v0.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v0.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED +TOOLTEST h5clear_sec2_v0.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v0.h5 $SUCCEED # -OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED -TOOLTEST $TESTDIR/h5clear_sec2_v2.h5 -s "" $SUCCEED -OPEN_CHK $TESTDIR/h5clear_sec2_v2.h5 $SUCCEED +OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED +TOOLTEST h5clear_sec2_v2.h5 -s "" $SUCCEED +OPEN_CHK h5clear_sec2_v2.h5 $SUCCEED # # # -- cgit v0.12 From ea46fbe7c2bb3a8c8972c880f3609be20036d741 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 12:19:28 -0500 Subject: Correct typo of file name --- config/cmake/HDF5_Examples.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/cmake/HDF5_Examples.cmake.in b/config/cmake/HDF5_Examples.cmake.in index 04f72a0..2567bd8 100644 --- a/config/cmake/HDF5_Examples.cmake.in +++ b/config/cmake/HDF5_Examples.cmake.in @@ -87,6 +87,6 @@ if (WIN32) include (${CTEST_SCRIPT_DIRECTORY}\\HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}\\CTestScript.cmake) else () - include (${CTEST_SCRIPT_DIRECTORY}/HDF_Examples_options.cmake) + include (${CTEST_SCRIPT_DIRECTORY}/HDF5_Examples_options.cmake) include (${CTEST_SCRIPT_DIRECTORY}/CTestScript.cmake) endif () -- cgit v0.12 From 7ee229bceddc1c0cd8d9ba2b7382d6d74ba0527b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 13:45:27 -0500 Subject: Updates to CMake for the changes in the autotools script --- tools/test/misc/CMakeLists.txt | 13 ++--- tools/test/misc/CMakeTestsClear.cmake | 94 +++++++++++++++++++++++++++++------ 2 files changed, 87 insertions(+), 20 deletions(-) diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index 97a6f0c..5e3c0a2 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -17,6 +17,13 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) #add_test (NAME h5repart_gentest COMMAND $) + add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) + TARGET_NAMING (h5clear_gentest STATIC) + TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") + target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) + set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) + #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) + add_subdirectory (${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/vds) endif () @@ -27,12 +34,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib) target_link_libraries (h5repart_test ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) set_target_properties (h5repart_test PROPERTIES FOLDER tools) - add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) - TARGET_NAMING (h5clear_gentest STATIC) - TARGET_C_PROPERTIES (h5clear_gentest STATIC " " " ") - target_link_libraries (h5clear_gentest ${HDF5_LIB_TARGET} ${HDF5_TOOLS_LIB_TARGET}) - set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) - add_executable (clear_open_chk ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/clear_open_chk.c) TARGET_NAMING (clear_open_chk STATIC) TARGET_C_PROPERTIES (clear_open_chk STATIC " " " ") diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index a92d523..5f40514 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -8,20 +8,32 @@ # -------------------------------------------------------------------- # Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- + set (HDF5_TEST_FILES + h5clear_log_v3.h5 + h5clear_mdc_image.h5 + mod_h5clear_mdc_image.h5 + latest_h5clear_log_v3.h5 + latest_h5clear_sec2_v3.h5 + ) + set (HDF5_SEC2_TEST_FILES + h5clear_sec2_v0.h5 + h5clear_sec2_v2.h5 + h5clear_sec2_v3.h5 + ) set (HDF5_REFERENCE_TEST_FILES h5clear_usage.ddl h5clear_open_fail.ddl h5clear_missing_file.ddl h5clear_no_mdc_image.ddl - orig_h5clear_sec2_v0.h5 - orig_h5clear_sec2_v2.h5 - orig_h5clear_sec2_v3.h5 - mod_h5clear_mdc_image.h5 ) - foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) + foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES} ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5clear_files") endforeach () + # make second copy of h5clear_sec2.h5 + foreach (h5_file ${HDF5_SEC2_TEST_FILES}) + HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" "h5clear_files") + endforeach () # make second copy of mod_h5clear_mdc_image.h5 HDFTEST_COPY_FILE("${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" "h5clear_files") add_custom_target(h5clear_files ALL COMMENT "Copying files needed by h5clear tests" DEPENDS ${h5clear_files_list}) @@ -73,6 +85,16 @@ macro (ADD_H5_TEST testname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR-clear_open_chk-copy_${testname}.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-clear_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-clear_open_chk-copy_${testname}.h5") # Initial file open fails OR # File open succeeds because the library does not check status_flags for file with < v3 superblock add_test (NAME H5CLEAR-clear_open_chk-${testname}_${resultcode} COMMAND $ ${testname}.h5) @@ -101,6 +123,7 @@ # # # The following are tests to verify the status_flags field is cleared properly: +if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( NAME H5CLEAR-clearall-objects @@ -111,19 +134,66 @@ h5clear_sec2_v0.h5 h5clear_sec2_v2.h5 h5clear_sec2_v3.h5 + orig_h5clear_sec2_v0.h5 + orig_h5clear_sec2_v2.h5 + orig_h5clear_sec2_v3.h5 latest_h5clear_log_v3.h5 latest_h5clear_sec2_v3.h5 + mod_h5clear_mdc_image.h5 + mod_h5clear_mdc_image2.h5 ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5CLEAR-clearall-objects") - # create the output files to be used. - add_test (NAME H5CLEAR-h5clear_gentest COMMAND $) - set_tests_properties (H5CLEAR-h5clear_gentest PROPERTIES DEPENDS "H5CLEAR-clearall-objects") - set_tests_properties (H5CLEAR-h5clear_gentest PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set (last_test "H5CLEAR-h5clear_gentest") + foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES}) + add_test ( + NAME H5CLEAR-copy_${h5_file} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_${h5_file} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_${h5_file}") + endforeach () + # make second copy of h5clear_sec2.h5 + foreach (h5_file ${HDF5_SEC2_TEST_FILES}) + add_test ( + NAME H5CLEAR-copy_orig_${h5_file} + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_orig_${h5_file} PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_orig_${h5_file}") + endforeach () + add_test ( + NAME H5CLEAR-copy_mod_h5clear_mdc_image.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image.h5") + # make second copy of mod_h5clear_mdc_image.h5 + add_test ( + NAME H5CLEAR-copy_mod_h5clear_mdc_image2.h5 + COMMAND ${CMAKE_COMMAND} + -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" + ) + if (NOT "${last_test}" STREQUAL "") + set_tests_properties (H5CLEAR-copy_mod_h5clear_mdc_image2.h5 PROPERTIES DEPENDS ${last_test}) + endif () + set (last_test "H5CLEAR-copy_mod_h5clear_mdc_image2.h5") +endif() # # @@ -191,7 +261,3 @@ ADD_H5_TEST (latest_h5clear_log_v3 "true") ADD_H5_TEST (h5clear_sec2_v0 "false") ADD_H5_TEST (h5clear_sec2_v2 "false") - - set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} - h5clear_gentest - ) -- cgit v0.12 From 9a7b106d3776a8454b5cb9443f11aae2873cc617 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 20 Apr 2017 14:57:36 -0500 Subject: Correct test options to match autotools script --- tools/test/misc/CMakeTestsClear.cmake | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index 5f40514..41aea4a 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -200,15 +200,15 @@ endif() # # The following are tests to verify the expected output from h5clear # "h5clear -h" -# "h5clear" (no options, no file) -# "h5clear junk.h5" (no options, nonexisting file) -# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) -# "h5clear -m" (valid 1 option, no file) -# "h5clear -s junk.h5" (valid 1 option, nonexisting file) -# "h5clear -m -s junk.h5" (valid 2 options, no file) -# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) -# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) -# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) +# "h5clear" (no options, no file) +# "h5clear junk.h5" (no options, nonexisting file) +# "h5clear orig_h5clear_sec2_v3.h5" (no options, existing file) +# "h5clear -m" (valid 1 option, no file) +# "h5clear -s junk.h5" (valid 1 option, nonexisting file) +# "h5clear -m -s" (valid 2 options, no file) +# "h5clear -m -s junk.h5" (valid 2 options, nonexisting file) +# "h5clear -m orig_h5clear_sec2_v2.h5" (valid 1 option, existing file, no cache image) +# "h5clear -s -m orig_h5clear_sec2_v0.h5" (valid 2 options, existing file, no cache image) ADD_H5_CMP (h5clear_usage_h h5clear_usage 0 "-h") ADD_H5_CMP (h5clear_usage h5clear_usage 1 "") ADD_H5_CMP (h5clear_usage_junk h5clear_usage 1 "" junk.h5) @@ -218,7 +218,7 @@ endif() ADD_H5_CMP (h5clear_missing_file_ms h5clear_missing_file 1 "-m" "-s") ADD_H5_CMP (h5clear_open_fail_ms h5clear_open_fail 1 "-m" "-s" junk.h5) ADD_H5_CMP (h5clear_no_mdc_image_m h5clear_no_mdc_image 0 "-m" orig_h5clear_sec2_v2.h5) - ADD_H5_CMP (h5clear_no_mdc_image_ms h5clear_no_mdc_image 0 "-m" "-s" orig_h5clear_sec2_v0.h5) + ADD_H5_CMP (h5clear_no_mdc_image_ms h5clear_no_mdc_image 0 "-s" "-m" orig_h5clear_sec2_v0.h5) # # # @@ -230,9 +230,9 @@ endif() # "h5clear -l h5clear_sec2_v2.h5" (invalid 1 option, existing file, fail exit code) # "h5clear -m -k" (valid/invalid 2 options, nofile, fail exit code) # "h5clear -l -m" (invalid/valid 2 options, nofile, fail exit code) -# "h5clear -m -k junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) +# "h5clear -m -l junk.h5" (valid/invalid 2 options, nonexisting file, fail exit code) # "h5clear -l -m junk.h5" (invalid/valid 2 options, nonexisting file, fail exit code) -# "h5clear -m -k h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) +# "h5clear -m -l h5clear_sec2_v0.h5" (valid/invalid 2 options, existing file, fail exit code) # "h5clear -l -m h5clear_sec2_v0.h5" (invalid/valid 2 options, existing file, fail exit code) ADD_H5_RETTEST (h5clear_mdc_image "false" "-m" h5clear_mdc_image.h5) ADD_H5_RETTEST (h5clear_vers "false" "--vers") @@ -243,14 +243,14 @@ endif() ADD_H5_RETTEST (h5clear_lm "true" "-l" "-m") ADD_H5_RETTEST (h5clear_ml_junk "true" "-m" "-l" junk.h5) ADD_H5_RETTEST (h5clear_lm_junk "true" "-l" "-m" junk.h5) - ADD_H5_RETTEST (h5clear_ml_sec2 "true" "-m" "-l" h5clear_sec2_v2.h5) - ADD_H5_RETTEST (h5clear_lm_sec2 "true" "-l" "-m" h5clear_sec2_v2.h5) + ADD_H5_RETTEST (h5clear_ml_sec2 "true" "-m" "-l" h5clear_sec2_v0.h5) + ADD_H5_RETTEST (h5clear_lm_sec2 "true" "-l" "-m" h5clear_sec2_v0.h5) # # # # h5clear_mdc_image.h5 already has cache image removed earlier, verify the expected warning from h5clear: ADD_H5_CMP (h5clear_mdc_image_m h5clear_no_mdc_image 0 "-m" mod_h5clear_mdc_image.h5) - ADD_H5_CMP (h5clear_mdc_image_sm h5clear_no_mdc_image 0 "-m" "-s" mod_h5clear_mdc_image2.h5) + ADD_H5_CMP (h5clear_mdc_image_sm h5clear_no_mdc_image 0 "-s" "-m" mod_h5clear_mdc_image2.h5) # # # -- cgit v0.12 From 5ed622b9ca432f1b440e8903680695ac83e28301 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Thu, 20 Apr 2017 16:11:47 -0400 Subject: The cache_image test shows a skipped message about EoC in parallel. --- src/H5Pfapl.c | 1 - test/cache_image.c | 18 +++++++++--------- test/evict_on_close.c | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index 8bd53a9..e47a4b0 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -4401,7 +4401,6 @@ H5Pset_evict_on_close( FUNC_ENTER_API(FAIL) H5TRACE2("e", "ib", fapl_id, evict_on_close); - /* Compare the property list's class against the other class */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property list is not a file access plist") diff --git a/test/cache_image.c b/test/cache_image.c index 31d7705..378c21e 100644 --- a/test/cache_image.c +++ b/test/cache_image.c @@ -62,10 +62,7 @@ static unsigned cache_image_api_error_check_3(void); static unsigned cache_image_api_error_check_4(void); static unsigned get_free_sections_test(void); - -#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void); -#endif /* H5_HAVE_PARALLEL */ /****************************************************************************/ @@ -7714,10 +7711,10 @@ get_free_sections_test(void) * *------------------------------------------------------------------------- */ -#ifndef H5_HAVE_PARALLEL static unsigned evict_on_close_test(void) { +#ifndef H5_HAVE_PARALLEL const char * fcn_name = "evict_on_close_test()"; char filename[512]; hbool_t show_progress = FALSE; @@ -7726,9 +7723,16 @@ evict_on_close_test(void) H5F_t *file_ptr = NULL; H5C_t *cache_ptr = NULL; int cp = 0; +#endif /* H5_HAVE_PARALLEL */ TESTING("Cache image / evict on close interaction"); +#ifdef H5_HAVE_PARALLEL + SKIPPED(); + HDputs(" EoC not supported in the parallel library."); + return 0; +#else + pass = TRUE; if ( show_progress ) @@ -8017,9 +8021,9 @@ evict_on_close_test(void) FUNC, failure_mssg); return !pass; +#endif /* H5_HAVE_PARALLEL */ } /* evict_on_close_test() */ -#endif /* H5_HAVE_PARALLEL */ /*------------------------------------------------------------------------- @@ -8071,13 +8075,9 @@ main(void) nerrs += cache_image_api_error_check_4(); nerrs += get_free_sections_test(); - -#ifndef H5_HAVE_PARALLEL nerrs += evict_on_close_test(); -#endif /* H5_HAVE_PARALLEL */ return(nerrs > 0); } /* main() */ - diff --git a/test/evict_on_close.c b/test/evict_on_close.c index 8196ea1..147976b 100644 --- a/test/evict_on_close.c +++ b/test/evict_on_close.c @@ -808,7 +808,6 @@ error: } /* check_dset_scheme() */ - /*------------------------------------------------------------------------- * Function: check_evict_on_close_api() -- cgit v0.12 From 3968c5c3bf16dc23a0a2ff1fa8d6c64dd2f8d32a Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 21 Apr 2017 10:07:30 -0500 Subject: Fix parameter form --- src/H5PL.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/H5PL.c b/src/H5PL.c index a083f5a..9bdd0ba 100644 --- a/src/H5PL.c +++ b/src/H5PL.c @@ -417,7 +417,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLappend(const char* plugin_path) +H5PLappend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -450,7 +450,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLprepend(const char* plugin_path) +H5PLprepend(const char *plugin_path) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -486,7 +486,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLreplace(const char* plugin_path, unsigned int index) +H5PLreplace(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; @@ -520,7 +520,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5PLinsert(const char* plugin_path, unsigned int index) +H5PLinsert(const char *plugin_path, unsigned int index) { herr_t ret_value = SUCCEED; /* Return value */ char *dl_path = NULL; -- cgit v0.12